Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Friday, March 30, 2012

How can i reset the Primary key field numbers to zero before uploading my site to the prod

I have been testing my database application for a while now. As a result i have a lot of records already with their respective identity field values. What i want to do is to reset this field to 0 (zero) before i deploy the aplication. I have tried deleting all the records and entered one to see if the id will be 1 but it still starts from where it was before i deleted the records. Any ideas.DBCC CHECKIDENT (tableName, RESEED, 0)|||

usingtruncate tablewill help you.

thanks,

satish.

sql

Wednesday, March 28, 2012

How can I re-install the Northwind database in SQL Server Management Studio Express?Use SqlDataS

Hi all,

In my VB 2005 Express, I created a Windowds Form application "shcDataSet" that used 1 SqlConnection, 1 SqlDataSet and 3 SqlDataAdapters associated with the Northwind Database in my SQL Server Management Studio Express. The SqlConnection had "User Instance" in the following ConnectionString: Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\northwnd.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True. The 3 SqlDataAdapters were for the Northwind files "Customers", "Orders" and "Order Details" used in the SQLDataSet "AllOrders" with a AllOrders.xsd file. I ran the "shcDataSet" applicatyion and it worked fine. After the execution of "shcDataSet", I checked the Northwind database in my SQL Server Management Studio Express and clicked on "+" in front of Northwind database-I did not see any file showed up and I got the following error message: Failed to retrieve data for this request. (Microsoft.SqlServer.Express.SmoEnum) Additional information: one or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup. (Microsoft SQL Server, Error:5173). If I executed the "shcDataSet" application again, I got a new error: SqlException was unhandled - Cannot open user default database. Login failed. Login failed for user 'myPC##\myName' ->daCustomers.Fill(AllOrders11, "Customers"). I have 3 questions to ask: (1) How can I re-install the Northwind database in SQL Server Management Studio Express? (2) When I use the .Fill Method, do I have to tell the SQL Server Management Studio Express to load and/or unload the Northwind files "Customers", "Orders" and "Order Details"? (3) After I executed the "shcDataSet", should I Upload the 3 Northwind files back to the SQL Server Management Studio Express? Please help and advise. Thanks, Scott Chang

this is a very common problem in SQL Server Express user intance. YOu are using user instance feature of SQL Server 2005 Express. If you are not intended to do it.. then change the connection string.

Refer this blog :

http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-instances-in-management-studio.aspx

Madhu

|||

Hi Madhu, Thanks for your response.

I am new in using the "User Instance" in SQL Server Express and VB 2005 Express. This is the first time I tried to learn it by copying the example from a book. I plan to apply the same technique to my own chemical database and applications for my data management. I do not understand what you said by "If you are not intended to do it.. then change the connection string". Please be specific and give me more details about your statement.

I read the blogs you mentioned and the MS Technical Articles "SQL Server 2005 Express Edition User Instances", "How to: Move Through a DataSet with the Windows Forms BindingNavigator Control", "Connecting to Data with Server Express/Database Express". etc. and I still do not get what you said and the User-Instances Connection, SSEUtil, instance_pipe_name, etc. Please answer my 3 questions stated in my last post in the easy terms for me.

Thanks,

Scott Chang

|||

Hi Madhu, Thanks for your response.

I am new in using "User Instance" and I do not understand what you meant by "If you are not intended to do it, then change the connection string". I want to use it and I just want to see what happened and whether the Northwind Database is in SQL Server Management Studio Express or not. This is the first time I learned the User Instance by doing the example of using User Instance example from a book. I plan to apply the User Instance tecjnique to my chemical database and data management applications in VB 2005 Express-ADO.NET 2.0 programming. If I loose my chemical database during the application of User Instance, it is not possible for me to retrieve the chemical database. I read the blogs you cited and the MS technical articles "SQL Server 2005 Express Edition User Instances", "Connecting to Data with Server Explorer/Database Explorer", "How to: Install and Troubleshoot Database Components for Samples", etc. I do not understand why SSEUtil and Instance_Pipe_Name are used in the connecting to User Instances. Please clarify what you meant by "If you are not intended to do it, then change the connection string" and answer my 3 questions in a easy-to-undersatnd way for me.

Thanks,

Scott Chang

|||

normally, Userinstance of sql server is used unknowingly. that is what i mentioned in my previous post. if you really want to use userinstance of sql server express ... then its ok.... This feature is only available in SQL Server Expess. This one kind of embeded datbase with your application. Handling of Normal and user instance database are totally different. Its already mentioned in above mentioned link. My question is, do you need to use this feature in your application ... this will ofcouse increase the managebility of your Visual studio application (no need to create the database explicitly when you distribute the application) but it has lot of limitations also

Madhu

|||

Hi Madhu,

I am lost completely now and do not want to do the User Instance any more - I just want to repair/restore the Northwind Database in my SQL Server Management Studio Express now. This morning, I downloaded the Northwind and Pubs Sample Databases from http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46a0-8da2-eebc53a68034&DisplayLang=en/ and saved SQL200SampleDb.msi in my PC. I double-clicked the SQL2000SampleDb.msi file to install the Northwind database - it ran, but the Northwind database in my SQL Server Management Studio Express had no files to show, when I clicked the '+' in front of the Northwind node!!!? What is wrong in my PC? Do I have to delete the User Instance=True of the Connection String of my "shcDataSet" project when executed? Please help me in restoring/repairing the Northwind Database in my SQL Server Management Studio Express?

Many Thanks,

Scott Chang

|||

post the connection string... if you don't want user instance.. yes you need to change the connection string...

For Connection string Refer : http://www.connectionstrings.com/?carrier=sqlserver2005

And also ... sql server 2005 sample datbase is Adventureworks... Northwind still you can use , but many new features like schema and all will not be available in that. you can download Adventureworks database from the link mentioned below

http://www.microsoft.com/downloads/details.aspx?familyid=e719ecf7-9f46-4312-af89-6ad8702e4e6e&displaylang=en

Madhu

|||

Hi Madhu, Thanks for your response.

1) I went to the CANtrol Panel => Add or Remove Program => removed the old Microsoft SQL Server 2005 Samples. Then I downloaded the new Microsoft SQL Server 2005 Samples from

http://www.microsoft.com/downloads/details.aspx?familyid=e719ecf7-9f46-4312-af89-6ad8702e4e6e&displaylang=en (as you said).

I checked the SQL Server Management Studio Express and looked at the Northwind Database and I still did not see any files in the Northwind Database!!!? Please tell me how I bring the files of Northwind Database to the SQL Server Management Studio Express (i. e. how to repair it.).

2) I do not understand whay you mean by "if you don't want user instance.. yes you need to change the connection string...

For Connection string Refer : http://www.connectionstrings.com/?carrier=sqlserver2005". Please elaborate this matter if you can. Pardon me for asking this thing.

Thanks again,

Scott Chang

Friday, March 23, 2012

How can i populate sql server db with data in french ??

I'm trying to do it , but i see only ''' symbols instead my data in french.
When i retrieve it in .NET application i have ''' symbols in datagrid too.
Please help me, thanksare you using unicode data types to store your textual data? IE: nvarchar,
nchar, ntext
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Database change management for SQL Server
"Oxana" wrote:

> I'm trying to do it , but i see only ''' symbols instead my data in frenc
h.
> When i retrieve it in .NET application i have ''' symbols in datagrid too
.
> Please help me, thanks

how can I populate data in a one-to-one relationship

Here is what I have and (somewhat understand). I'm using Visual WebDeveloper 2005 Express Edition and have setup my application to use form authentication(which automatically creates the ASPNETDB.MDF file with several default tablesand views). I'm using the CreateUserWizardwhich is fine…but I need to collect additional information like (firstname,lastname, address…and on..). What I'vedone. I've created a tabled namedUserProfile and set UserId as the primary key (uniqueidentifier). I then setup a 1-to-1 relationshipbetween aspnet_Users and UserProfile (which I think is correct). On my UpdateContactInfo.aspx page (whereusers go to update their personal information) I use a hidden label control(UserValue) to receive the UserId during the page_load event as below:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
UserValue.Text = Membership.GetUser().ProviderUserKey().ToString()
End Sub

Now with the UserID available I need to populate theUserProfile table with the UserId, firstname, lastname, address of thecurrently logged in user. How can I do this and am I on theright track..?

Then you can use a SqlCommand to issue the insert command to the UserProfile anywhere you like in your code:

using (SqlConnection conn= new SqlConnection(@."Data Source=(local);Integrated Security=SSPI;Database=mydb;");
{
connection.Open();

SqlCommand cmd = new SqlCommand("insert into UserProfile select @.UserId, @.firstname, @.lastname, @.address", conn);
cmd.Parameters.Add("@.UserId", SqlDbType.UniqueIdentifier);
cmd.Parameters["@.UserID"] = UserValue.Text;
//add all parameters and set their values
cmd.ExecuteNonQuery();
conn.Close();

}

|||

Why aren't you using the built-in profile system?

Why are you setting a hidden form field (Which can be spoofed) to store the userid, instead of a session variable or just looking it up when you want to do the update?

|||How do I go about retrieving the current user's [UserId] information from the session variable? And what is stored inside the session variable by default. Also... I've done some reading on the built-in profile system and have walked through the [ASP.NET HOW DO I Video Series: Profiles and Themes ] . My next question is...what if I wanted to store items in my profile that is not of type: string. So far all the property values that have been stored in the profiles table are all storing as type: string. I would like to store some of these properties as an integer type.|||

The profile can store anything that can be automaticlly converted to and from a string (That includes datetime, integer, float, decimal, and a lot of other obejcts).

You can retrieve the state of the session variable in a sqldatasource by selecting the parameter as type "Session" and the sessionkey of whatever you used.

In code after authentication, for example, put this code:

Session("UserID")=membership.getuser().whatever (Sorry, I forget the exact syntax)

Then in sqldatasource, the parameter type is session, with the key being "UserID".

|||Thanks for all the help! I'm now using the profile to store user information (firstname, lastname, age, address...). However I think I've ran into another problem :( Becuase the profile date is stored in a serialized format blob... I cant easily query the database and perform common sql routines. I would like to display all users and their profile data within a gridview but can't figure how to do that. I've read the TableProfileProvider how-tohttp://www.asp.net/sandbox/samp_profiles.aspx?tabindex=0&tabid=1 but the source code is not in VB.NET. Can someone advise... thanks.|||

I had to write my own T-SQL function to pull out profile properties from the blobified format. Not elegant, and definately not fast. You would probably be better off pulling back usernames in a dataset, then calling the membership object to pull the properties and appending them to the dataset, then binding that to the datagrid.

I wish I had time to finish my profile provider. Unfortunately, I've been to busy to go back to revist it since my deblobify function works ok for what I needed at the time. If you want to use the TableProfileProvider, you should be able to compile it into a dll, then reference it from within your VB.NET web application just fine. But I haven't tried it, as I usually just convert stuff from C# to VB myself, and leave it as source in the project.

How can I open hyperlink in a new window?

I have a number of dynamically configured hyperlinks in my report. Clicking
on them, takes user to a different application. I want for this new app to
open in a different browser window from the report itself, but instead it
opens in the same window and replaces my report data. Any ideas how to force
it to open in a new window?
Thank you!Copied from newsgroup:
You put it in the document map label. This is a standard thing for
hyperlinks. You can also use _self, _top, _parent, etc...
From Books Online,
"Advanced Textbox Properties (Navigation Tab)
Use the Navigation tab of the Advanced Textbox Properties dialog box to
define navigation options for the text box.
Options
Document map label
Type or select a label or an expression that evaluates to a label. Click the
expression (fx) button to edit the expression. The value of the label
appears on the document map."
HTH, Jens Suessmeyer,.
http://www.sqlserver2005.de
--
"Misha_SQL" <Misha_SQL@.discussions.microsoft.com> schrieb im Newsbeitrag
news:AB7CB9AF-6CAA-4A13-9A75-8FF174E9E5D3@.microsoft.com...
>I have a number of dynamically configured hyperlinks in my report.
>Clicking
> on them, takes user to a different application. I want for this new app
> to
> open in a different browser window from the report itself, but instead it
> opens in the same window and replaces my report data. Any ideas how to
> force
> it to open in a new window?
> Thank you!|||Some more links:
#1:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RShowto/htm/hrs_designer_v1_6mwb.asp
#2: Take a look at _LinkTarget device info setting:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_soapapi_dev_3i49.asp
Jens Suessmeyer.
"Jens Süßmeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> schrieb
im Newsbeitrag news:uv4rf7dRFHA.3716@.TK2MSFTNGP14.phx.gbl...
> Copied from newsgroup:
>
> You put it in the document map label. This is a standard thing for
> hyperlinks. You can also use _self, _top, _parent, etc...
> From Books Online,
> "Advanced Textbox Properties (Navigation Tab)
> Use the Navigation tab of the Advanced Textbox Properties dialog box to
> define navigation options for the text box.
> Options
> Document map label
> Type or select a label or an expression that evaluates to a label. Click
> the expression (fx) button to edit the expression. The value of the label
> appears on the document map."
>
> HTH, Jens Suessmeyer,.
>
>
> --
> http://www.sqlserver2005.de
> --
> "Misha_SQL" <Misha_SQL@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:AB7CB9AF-6CAA-4A13-9A75-8FF174E9E5D3@.microsoft.com...
>>I have a number of dynamically configured hyperlinks in my report.
>>Clicking
>> on them, takes user to a different application. I want for this new app
>> to
>> open in a different browser window from the report itself, but instead it
>> opens in the same window and replaces my report data. Any ideas how to
>> force
>> it to open in a new window?
>> Thank you!
>|||For the following you need SP1 or greater installed.
= "javascript:void(window.open('http://www.google.com','_blank'))"
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Misha_SQL" <Misha_SQL@.discussions.microsoft.com> wrote in message
news:AB7CB9AF-6CAA-4A13-9A75-8FF174E9E5D3@.microsoft.com...
> I have a number of dynamically configured hyperlinks in my report.
Clicking
> on them, takes user to a different application. I want for this new app
to
> open in a different browser window from the report itself, but instead it
> opens in the same window and replaces my report data. Any ideas how to
force
> it to open in a new window?
> Thank you!|||Thank you, Jens!
These links contained information that solved my problem.
"Jens Sü�meyer" wrote:
> Some more links:
> #1:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RShowto/htm/hrs_designer_v1_6mwb.asp
> #2: Take a look at _LinkTarget device info setting:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_soapapi_dev_3i49.asp
>
> Jens Suessmeyer.
> "Jens Sü�meyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> schrieb
> im Newsbeitrag news:uv4rf7dRFHA.3716@.TK2MSFTNGP14.phx.gbl...
> > Copied from newsgroup:
> >
> >
> > You put it in the document map label. This is a standard thing for
> > hyperlinks. You can also use _self, _top, _parent, etc...
> >
> > From Books Online,
> >
> > "Advanced Textbox Properties (Navigation Tab)
> > Use the Navigation tab of the Advanced Textbox Properties dialog box to
> > define navigation options for the text box.
> >
> > Options
> >
> > Document map label
> > Type or select a label or an expression that evaluates to a label. Click
> > the expression (fx) button to edit the expression. The value of the label
> > appears on the document map."
> >
> >
> >
> > HTH, Jens Suessmeyer,.
> >
> >
> >
> >
> >
> > --
> >
> > http://www.sqlserver2005.de
> >
> > --
> >
> > "Misha_SQL" <Misha_SQL@.discussions.microsoft.com> schrieb im Newsbeitrag
> > news:AB7CB9AF-6CAA-4A13-9A75-8FF174E9E5D3@.microsoft.com...
> >>I have a number of dynamically configured hyperlinks in my report.
> >>Clicking
> >> on them, takes user to a different application. I want for this new app
> >> to
> >> open in a different browser window from the report itself, but instead it
> >> opens in the same window and replaces my report data. Any ideas how to
> >> force
> >> it to open in a new window?
> >>
> >> Thank you!
> >
> >
>
>|||Hi Bruce/Misha,
I tried the solution given below and it opens in the new window with the URL
given,even when i change it to "_Self".
Please note i am trying to open the url in a particular frame and not the
full window.
And also i see that "javascript:void(window.open
'http://www.google.com','_blank'))" gets pasted in the address bar of the IE
, removing all the frames and also the page is not loaded untill i press the
enter key.
Please help me find a solution to this.
Thanks in advance,
Regads,
Archana Kamath
"Bruce L-C [MVP]" wrote:
> For the following you need SP1 or greater installed.
> = "javascript:void(window.open('http://www.google.com','_blank'))"
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "Misha_SQL" <Misha_SQL@.discussions.microsoft.com> wrote in message
> news:AB7CB9AF-6CAA-4A13-9A75-8FF174E9E5D3@.microsoft.com...
> > I have a number of dynamically configured hyperlinks in my report.
> Clicking
> > on them, takes user to a different application. I want for this new app
> to
> > open in a different browser window from the report itself, but instead it
> > opens in the same window and replaces my report data. Any ideas how to
> force
> > it to open in a new window?
> >
> > Thank you!
>
>|||Window.open create a new browser window. You want soemthign like:
(javascript)
Window.parent.FRAMENAME.src = 'http://www.google.com'
or
<a href='http://www.google.com' target='FRAMENAME'>Insert Text Here</a>
"Archana" <Archana@.discussions.microsoft.com> wrote in message
news:992668D3-C45F-4950-ACE0-E7D04FB034DF@.microsoft.com...
> Hi Bruce/Misha,
> I tried the solution given below and it opens in the new window with the
URL
> given,even when i change it to "_Self".
> Please note i am trying to open the url in a particular frame and not the
> full window.
> And also i see that "javascript:void(window.open
> 'http://www.google.com','_blank'))" gets pasted in the address bar of the
IE
> , removing all the frames and also the page is not loaded untill i press
the
> enter key.
> Please help me find a solution to this.
> Thanks in advance,
> Regads,
> Archana Kamath
>
> "Bruce L-C [MVP]" wrote:
> > For the following you need SP1 or greater installed.
> >
> > = "javascript:void(window.open('http://www.google.com','_blank'))"
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> >
> >
> > "Misha_SQL" <Misha_SQL@.discussions.microsoft.com> wrote in message
> > news:AB7CB9AF-6CAA-4A13-9A75-8FF174E9E5D3@.microsoft.com...
> > > I have a number of dynamically configured hyperlinks in my report.
> > Clicking
> > > on them, takes user to a different application. I want for this new
app
> > to
> > > open in a different browser window from the report itself, but instead
it
> > > opens in the same window and replaces my report data. Any ideas how
to
> > force
> > > it to open in a new window?
> > >
> > > Thank you!
> >
> >
> >|||Thanks Jim for a quick response.
But i am still facing the problem.
The problem is Reporting services report expression doesnot accept "<a href>".
And when i try to give the javascript,it doesnot get exceuted.What it simply
does is opens up a new browser and paste the javascript on the adress bar.It
doesnt not get executed untill we press the enter key.
In most of the solutions for such problems they have suggested to use the
javascript.But in my case, it doesnt get executed at all.
Do i need to set any internet settings so that javascript get executed with
out user pressing the enter key.
Please help me out with this issue.
Many Thanks,
Archana
"Jim Underwood" wrote:
> Window.open create a new browser window. You want soemthign like:
> (javascript)
> Window.parent.FRAMENAME.src = 'http://www.google.com'
> or
> <a href='http://www.google.com' target='FRAMENAME'>Insert Text Here</a>
> "Archana" <Archana@.discussions.microsoft.com> wrote in message
> news:992668D3-C45F-4950-ACE0-E7D04FB034DF@.microsoft.com...
> > Hi Bruce/Misha,
> >
> > I tried the solution given below and it opens in the new window with the
> URL
> > given,even when i change it to "_Self".
> >
> > Please note i am trying to open the url in a particular frame and not the
> > full window.
> >
> > And also i see that "javascript:void(window.open
> > 'http://www.google.com','_blank'))" gets pasted in the address bar of the
> IE
> > , removing all the frames and also the page is not loaded untill i press
> the
> > enter key.
> >
> > Please help me find a solution to this.
> >
> > Thanks in advance,
> > Regads,
> > Archana Kamath
> >
> >
> > "Bruce L-C [MVP]" wrote:
> >
> > > For the following you need SP1 or greater installed.
> > >
> > > = "javascript:void(window.open('http://www.google.com','_blank'))"
> > >
> > >
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
> > >
> > >
> > >
> > > "Misha_SQL" <Misha_SQL@.discussions.microsoft.com> wrote in message
> > > news:AB7CB9AF-6CAA-4A13-9A75-8FF174E9E5D3@.microsoft.com...
> > > > I have a number of dynamically configured hyperlinks in my report.
> > > Clicking
> > > > on them, takes user to a different application. I want for this new
> app
> > > to
> > > > open in a different browser window from the report itself, but instead
> it
> > > > opens in the same window and replaces my report data. Any ideas how
> to
> > > force
> > > > it to open in a new window?
> > > >
> > > > Thank you!
> > >
> > >
> > >
>
>|||Hi Jim,
Javascript works fine in the report.That is when i try opening the report
using the report manager /reportserver it works fine.When i click the link,
the page ('google') gets loaded.
But when i include the same report in my sharepoint site ,using the page
viewer webpart and try accessing the link,it throws up an error saying "Page
cannot be displayed" and the javascript gets pasted on the address bar.
Any idea why this behaviour?
Many thanks inadvance,
Regards,
Archana
"Archana" wrote:
> Thanks Jim for a quick response.
> But i am still facing the problem.
> The problem is Reporting services report expression doesnot accept "<a href>".
> And when i try to give the javascript,it doesnot get exceuted.What it simply
> does is opens up a new browser and paste the javascript on the adress bar.It
> doesnt not get executed untill we press the enter key.
> In most of the solutions for such problems they have suggested to use the
> javascript.But in my case, it doesnt get executed at all.
> Do i need to set any internet settings so that javascript get executed with
> out user pressing the enter key.
> Please help me out with this issue.
> Many Thanks,
> Archana
> "Jim Underwood" wrote:
> > Window.open create a new browser window. You want soemthign like:
> >
> > (javascript)
> > Window.parent.FRAMENAME.src = 'http://www.google.com'
> >
> > or
> > <a href='http://www.google.com' target='FRAMENAME'>Insert Text Here</a>
> >
> > "Archana" <Archana@.discussions.microsoft.com> wrote in message
> > news:992668D3-C45F-4950-ACE0-E7D04FB034DF@.microsoft.com...
> > > Hi Bruce/Misha,
> > >
> > > I tried the solution given below and it opens in the new window with the
> > URL
> > > given,even when i change it to "_Self".
> > >
> > > Please note i am trying to open the url in a particular frame and not the
> > > full window.
> > >
> > > And also i see that "javascript:void(window.open
> > > 'http://www.google.com','_blank'))" gets pasted in the address bar of the
> > IE
> > > , removing all the frames and also the page is not loaded untill i press
> > the
> > > enter key.
> > >
> > > Please help me find a solution to this.
> > >
> > > Thanks in advance,
> > > Regads,
> > > Archana Kamath
> > >
> > >
> > > "Bruce L-C [MVP]" wrote:
> > >
> > > > For the following you need SP1 or greater installed.
> > > >
> > > > = "javascript:void(window.open('http://www.google.com','_blank'))"
> > > >
> > > >
> > > > --
> > > > Bruce Loehle-Conger
> > > > MVP SQL Server Reporting Services
> > > >
> > > >
> > > >
> > > > "Misha_SQL" <Misha_SQL@.discussions.microsoft.com> wrote in message
> > > > news:AB7CB9AF-6CAA-4A13-9A75-8FF174E9E5D3@.microsoft.com...
> > > > > I have a number of dynamically configured hyperlinks in my report.
> > > > Clicking
> > > > > on them, takes user to a different application. I want for this new
> > app
> > > > to
> > > > > open in a different browser window from the report itself, but instead
> > it
> > > > > opens in the same window and replaces my report data. Any ideas how
> > to
> > > > force
> > > > > it to open in a new window?
> > > > >
> > > > > Thank you!
> > > >
> > > >
> > > >
> >
> >
> >|||HI Jim,
Thanks for your help.
The javascript works fine.There was some problem with mysharepoint page.
Anyways Many thanks
Regards,
Archana
"Archana" wrote:
> Hi Jim,
> Javascript works fine in the report.That is when i try opening the report
> using the report manager /reportserver it works fine.When i click the link,
> the page ('google') gets loaded.
> But when i include the same report in my sharepoint site ,using the page
> viewer webpart and try accessing the link,it throws up an error saying "Page
> cannot be displayed" and the javascript gets pasted on the address bar.
> Any idea why this behaviour?
> Many thanks inadvance,
> Regards,
> Archana
> "Archana" wrote:
> > Thanks Jim for a quick response.
> > But i am still facing the problem.
> > The problem is Reporting services report expression doesnot accept "<a href>".
> > And when i try to give the javascript,it doesnot get exceuted.What it simply
> > does is opens up a new browser and paste the javascript on the adress bar.It
> > doesnt not get executed untill we press the enter key.
> >
> > In most of the solutions for such problems they have suggested to use the
> > javascript.But in my case, it doesnt get executed at all.
> >
> > Do i need to set any internet settings so that javascript get executed with
> > out user pressing the enter key.
> >
> > Please help me out with this issue.
> >
> > Many Thanks,
> > Archana
> >
> > "Jim Underwood" wrote:
> >
> > > Window.open create a new browser window. You want soemthign like:
> > >
> > > (javascript)
> > > Window.parent.FRAMENAME.src = 'http://www.google.com'
> > >
> > > or
> > > <a href='http://www.google.com' target='FRAMENAME'>Insert Text Here</a>
> > >
> > > "Archana" <Archana@.discussions.microsoft.com> wrote in message
> > > news:992668D3-C45F-4950-ACE0-E7D04FB034DF@.microsoft.com...
> > > > Hi Bruce/Misha,
> > > >
> > > > I tried the solution given below and it opens in the new window with the
> > > URL
> > > > given,even when i change it to "_Self".
> > > >
> > > > Please note i am trying to open the url in a particular frame and not the
> > > > full window.
> > > >
> > > > And also i see that "javascript:void(window.open
> > > > 'http://www.google.com','_blank'))" gets pasted in the address bar of the
> > > IE
> > > > , removing all the frames and also the page is not loaded untill i press
> > > the
> > > > enter key.
> > > >
> > > > Please help me find a solution to this.
> > > >
> > > > Thanks in advance,
> > > > Regads,
> > > > Archana Kamath
> > > >
> > > >
> > > > "Bruce L-C [MVP]" wrote:
> > > >
> > > > > For the following you need SP1 or greater installed.
> > > > >
> > > > > = "javascript:void(window.open('http://www.google.com','_blank'))"
> > > > >
> > > > >
> > > > > --
> > > > > Bruce Loehle-Conger
> > > > > MVP SQL Server Reporting Services
> > > > >
> > > > >
> > > > >
> > > > > "Misha_SQL" <Misha_SQL@.discussions.microsoft.com> wrote in message
> > > > > news:AB7CB9AF-6CAA-4A13-9A75-8FF174E9E5D3@.microsoft.com...
> > > > > > I have a number of dynamically configured hyperlinks in my report.
> > > > > Clicking
> > > > > > on them, takes user to a different application. I want for this new
> > > app
> > > > > to
> > > > > > open in a different browser window from the report itself, but instead
> > > it
> > > > > > opens in the same window and replaces my report data. Any ideas how
> > > to
> > > > > force
> > > > > > it to open in a new window?
> > > > > >
> > > > > > Thank you!
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >|||I am glad to hear you got it working.
"Archana" <Archana@.discussions.microsoft.com> wrote in message
news:95947B79-1C8F-4850-A528-231B95C82451@.microsoft.com...
> HI Jim,
> Thanks for your help.
> The javascript works fine.There was some problem with mysharepoint page.
> Anyways Many thanks
> Regards,
> Archana
> "Archana" wrote:
> > Hi Jim,
> >
> > Javascript works fine in the report.That is when i try opening the
report
> > using the report manager /reportserver it works fine.When i click the
link,
> > the page ('google') gets loaded.
> >
> > But when i include the same report in my sharepoint site ,using the page
> > viewer webpart and try accessing the link,it throws up an error saying
"Page
> > cannot be displayed" and the javascript gets pasted on the address bar.
> >
> > Any idea why this behaviour?
> > Many thanks inadvance,
> > Regards,
> > Archana
> >
> > "Archana" wrote:
> >
> > > Thanks Jim for a quick response.
> > > But i am still facing the problem.
> > > The problem is Reporting services report expression doesnot accept "<a
href>".
> > > And when i try to give the javascript,it doesnot get exceuted.What it
simply
> > > does is opens up a new browser and paste the javascript on the adress
bar.It
> > > doesnt not get executed untill we press the enter key.
> > >
> > > In most of the solutions for such problems they have suggested to use
the
> > > javascript.But in my case, it doesnt get executed at all.
> > >
> > > Do i need to set any internet settings so that javascript get executed
with
> > > out user pressing the enter key.
> > >
> > > Please help me out with this issue.
> > >
> > > Many Thanks,
> > > Archana
> > >
> > > "Jim Underwood" wrote:
> > >
> > > > Window.open create a new browser window. You want soemthign like:
> > > >
> > > > (javascript)
> > > > Window.parent.FRAMENAME.src = 'http://www.google.com'
> > > >
> > > > or
> > > > <a href='http://www.google.com' target='FRAMENAME'>Insert Text
Here</a>
> > > >
> > > > "Archana" <Archana@.discussions.microsoft.com> wrote in message
> > > > news:992668D3-C45F-4950-ACE0-E7D04FB034DF@.microsoft.com...
> > > > > Hi Bruce/Misha,
> > > > >
> > > > > I tried the solution given below and it opens in the new window
with the
> > > > URL
> > > > > given,even when i change it to "_Self".
> > > > >
> > > > > Please note i am trying to open the url in a particular frame and
not the
> > > > > full window.
> > > > >
> > > > > And also i see that "javascript:void(window.open
> > > > > 'http://www.google.com','_blank'))" gets pasted in the address bar
of the
> > > > IE
> > > > > , removing all the frames and also the page is not loaded untill i
press
> > > > the
> > > > > enter key.
> > > > >
> > > > > Please help me find a solution to this.
> > > > >
> > > > > Thanks in advance,
> > > > > Regads,
> > > > > Archana Kamath
> > > > >
> > > > >
> > > > > "Bruce L-C [MVP]" wrote:
> > > > >
> > > > > > For the following you need SP1 or greater installed.
> > > > > >
> > > > > > ="javascript:void(window.open('http://www.google.com','_blank'))"
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Bruce Loehle-Conger
> > > > > > MVP SQL Server Reporting Services
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Misha_SQL" <Misha_SQL@.discussions.microsoft.com> wrote in
message
> > > > > > news:AB7CB9AF-6CAA-4A13-9A75-8FF174E9E5D3@.microsoft.com...
> > > > > > > I have a number of dynamically configured hyperlinks in my
report.
> > > > > > Clicking
> > > > > > > on them, takes user to a different application. I want for
this new
> > > > app
> > > > > > to
> > > > > > > open in a different browser window from the report itself, but
instead
> > > > it
> > > > > > > opens in the same window and replaces my report data. Any
ideas how
> > > > to
> > > > > > force
> > > > > > > it to open in a new window?
> > > > > > >
> > > > > > > Thank you!
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >

Wednesday, March 21, 2012

How can I modify a report in Crystal Report 7

I am a Web developer. I am new to VB 6.0 and Crystal Report. I have
joined an organisation where there is an application running(developed
in VB6 and crystal report 7). I have to modify one report. In two
columns I have to make minor changes i.e put and = operator. I am
encountering following problem:

1. When I open the report using Seagate crystal report for rational /
32 bit crystal Report Designer there are three columns which are going
out side the visible area and I am not able to scroll up to them. I
increased the page margin (left / right) and made it to zero and zero
but still I am not able to see those columns. Please guide.
2. Please suggest any good web site for learning Crystal Report 7

Thanks n Regards

Deepak Sinhamicrosoft . public . sqlserver wrote:

Quote:

Originally Posted by

1. When I open the report using Seagate crystal report for rational /
32 bit crystal Report Designer there are three columns which are going
out side the visible area and I am not able to scroll up to them. I
increased the page margin (left / right) and made it to zero and zero
but still I am not able to see those columns. Please guide.


Try setting the zoom level to something less than 100%.|||microsoft . public . sqlserver (dpk.sinha@.gmail.com) writes:

Quote:

Originally Posted by

I am a Web developer. I am new to VB 6.0 and Crystal Report. I have
joined an organisation where there is an application running(developed
in VB6 and crystal report 7). I have to modify one report. In two
columns I have to make minor changes i.e put and = operator. I am
encountering following problem:
>
1. When I open the report using Seagate crystal report for rational /
32 bit crystal Report Designer there are three columns which are going
out side the visible area and I am not able to scroll up to them. I
increased the page margin (left / right) and made it to zero and zero
but still I am not able to see those columns. Please guide.
2. Please suggest any good web site for learning Crystal Report 7


http://www.businessobjects.com/
They also have a web forum, where you probably better odds to get
good answers about Crystal than in an SQL Server forum.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

how can i manage database on lan base[network base]software

hi
my self avi
currently i am developing one application in vb 6 and back end as
sqlserver 7 which is used on lan.
i have some problem. like in my database i have one table salesvoucher
which has 'voucherno' field. when 2-3 user will work on salesform at a
time [since the softwrae will run on lan] then the same voucherno will
save for all users data which is wrong i need to save different voucherno
for each no. is there any way in sqlserver to apply some condition on
database or to set some its property[tables] so that at a time only one
users data will save depend on firstcome first serve base or is there any
way to make changes in programme.
plz help me regarding this i need it very badly.
since its my first lan based software plz give me some books name
regarding this software for vb6 and sqlserver7"avinash" <pawar_avinash@.rediffmail.com> wrote in message
news:00a8643e7e3050f1ff2f4ae6aa7209df@.localhost.ta lkaboutdatabases.com...
> hi
> my self avi
> currently i am developing one application in vb 6 and back end as
> sqlserver 7 which is used on lan.
> i have some problem. like in my database i have one table salesvoucher
> which has 'voucherno' field. when 2-3 user will work on salesform at a
> time [since the softwrae will run on lan] then the same voucherno will
> save for all users data which is wrong i need to save different voucherno
> for each no. is there any way in sqlserver to apply some condition on
> database or to set some its property[tables] so that at a time only one
> users data will save depend on firstcome first serve base or is there any
> way to make changes in programme.
> plz help me regarding this i need it very badly.
> since its my first lan based software plz give me some books name
> regarding this software for vb6 and sqlserver7

If the voucherno must be unique, then you should put a primary key or unique
constraint on that column, so that it's impossible to have duplicates. If
the voucherno is generated on the client, then you would have to handle the
error raised when a duplicate is inserted (such as error 2627 for primary
key violation), generate a new number, and submit it again.

Alternatively, you could generate the voucherno in the database. If you just
need an integer value, then you can use the IDENTITY property to generate
the number for you - see "IDENTITY (Property)" in Books Online. Every time
you insert a new row, MSSQL will generate a new number for you - this avoids
writing any code to generate new numbers.

Regarding books, you might find some useful information about SQL books
here:

http://vyaskn.tripod.com/sqlbooks.htm

Someone else may be able to suggest a good VB/SQL book, or you might want to
post in a VB group.

Simon|||Dear Avanish... sorry I cannot help you in dat... while I m just wanna
post a msg here... BYE

Monday, March 19, 2012

How can i lock a record

hi all iam working on a ticketing application i want to avoid two users to book the same ticket the requirement is as follows

1. the system should show all the available tickets which is not yet booked

2.when two users book the ticket at the same time time it should not allow the two persons to update at the same tme

the main aim is to avoid data concurency

how can i get this done

Use a flag or the best is to use time-stamps?

|||

Hi,

From your description, it seems that your problem is related to SQL concurrency issue.
Suppose each ticket is saved in your data table. For your first requirement, it can be achieved by using a flag which indicates if the ticket has been booked or not.
For your second requirement, since ADO.NET uses Optimistic Concurrency. Then locks are set and held only while the database is being accessed. The locks prevent other users from attempting to update records at the same instant. The data is always available except for the exact moment that an update is taking place.

In Optimistic Concurrency, there are two general ways to determine if changes have occurred: the version approach (true version numbers or date-time stamps) and the saving all values approach.

i.e. For Version Number approach, the record to be updated must have a column that contains a date-time stamp or version number. The date-time stamp or a version number is saved on the client when the record is read. This value is then made part of the update.

For more information, seehttp://msdn2.microsoft.com/en-us/library/cs6hb8k4(VS.71).aspx

Thanks!

Friday, March 9, 2012

How can I increase the Query Timeout Value

Is there a way to increase this value on the server or does it have to be
done at the application level? If at the app level, any suggestions as to
how.
TIA
Rob
1. Lunch EM
2. Right-click your server and select Properties.
3. Connections Tab
4. Look at your query & concurrent connection timeout settings.
Message posted via http://www.sqlmonster.com
|||Thanks, but doesn't that only apply to other servers. Or does it also apply
to clients?
"Sameer Premji via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:b80021ec3da446949b691d5fd8db0952@.SQLMonster.c om...
> 1. Lunch EM
> 2. Right-click your server and select Properties.
> 3. Connections Tab
> 4. Look at your query & concurrent connection timeout settings.
> --
> Message posted via http://www.sqlmonster.com
|||That setting applies only to the server.
You should allow a broader time-out setting at the server-level. However,
do not set it at 0 or unlimited time-out because you do not want a long-
running query or an unstable client app to bring down your server. If
someone executes 30 min query against your server, then your server will
for sure deprive other critical operations from executing and probably will
get bogged-down.
Queries are meant to execute very fast and you should make sure that they
are well tested and optimized before querying.
You should set each Client app's query time-out settings individually to a
reasonable minimum (obviously less than the max limit set at the server-
level).
For example, if you use Query Analyzer, a client app used to query SQL
server, you can set it its query time-out settings accordingly (Tools --
>Options -->Connections Tab).
If you are using a programming language, at the time of connection (via
ODBC or DSN or connection string) you can supply a parameter value for
query-time out to explicitly tell the server that I want you to allow this
specific query to run for 'n' seconds.
Hope its clear.
Message posted via http://www.sqlmonster.com

How can I increase the Query Timeout Value

Is there a way to increase this value on the server or does it have to be
done at the application level? If at the app level, any suggestions as to
how.
TIA
Rob1. Lunch EM
2. Right-click your server and select Properties.
3. Connections Tab
4. Look at your query & concurrent connection timeout settings.
--
Message posted via http://www.sqlmonster.com|||Thanks, but doesn't that only apply to other servers. Or does it also apply
to clients?
"Sameer Premji via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:b80021ec3da446949b691d5fd8db0952@.SQLMonster.com...
> 1. Lunch EM
> 2. Right-click your server and select Properties.
> 3. Connections Tab
> 4. Look at your query & concurrent connection timeout settings.
> --
> Message posted via http://www.sqlmonster.com|||That setting applies only to the server.
You should allow a broader time-out setting at the server-level. However,
do not set it at 0 or unlimited time-out because you do not want a long-
running query or an unstable client app to bring down your server. If
someone executes 30 min query against your server, then your server will
for sure deprive other critical operations from executing and probably will
get bogged-down.
Queries are meant to execute very fast and you should make sure that they
are well tested and optimized before querying.
You should set each Client app's query time-out settings individually to a
reasonable minimum (obviously less than the max limit set at the server-
level).
For example, if you use Query Analyzer, a client app used to query SQL
server, you can set it its query time-out settings accordingly (Tools --
>Options -->Connections Tab).
If you are using a programming language, at the time of connection (via
ODBC or DSN or connection string) you can supply a parameter value for
query-time out to explicitly tell the server that I want you to allow this
specific query to run for 'n' seconds.
Hope its clear.
--
Message posted via http://www.sqlmonster.com

How can I increase the Query Timeout Value

Is there a way to increase this value on the server or does it have to be
done at the application level? If at the app level, any suggestions as to
how.
TIA
Rob1. Lunch EM
2. Right-click your server and select Properties.
3. Connections Tab
4. Look at your query & concurrent connection timeout settings.
Message posted via http://www.droptable.com|||Thanks, but doesn't that only apply to other servers. Or does it also apply
to clients?
"Sameer Premji via droptable.com" <forum@.droptable.com> wrote in message
news:b80021ec3da446949b691d5fd8db0952@.SQ
droptable.com...
> 1. Lunch EM
> 2. Right-click your server and select Properties.
> 3. Connections Tab
> 4. Look at your query & concurrent connection timeout settings.
> --
> Message posted via http://www.droptable.com|||That setting applies only to the server.
You should allow a broader time-out setting at the server-level. However,
do not set it at 0 or unlimited time-out because you do not want a long-
running query or an unstable client app to bring down your server. If
someone executes 30 min query against your server, then your server will
for sure deprive other critical operations from executing and probably will
get bogged-down.
Queries are meant to execute very fast and you should make sure that they
are well tested and optimized before querying.
You should set each Client app's query time-out settings individually to a
reasonable minimum (obviously less than the max limit set at the server-
level).
For example, if you use Query Analyzer, a client app used to query SQL
server, you can set it its query time-out settings accordingly (Tools --
>Options -->Connections Tab).
If you are using a programming language, at the time of connection (via
ODBC or DSN or connection string) you can supply a parameter value for
query-time out to explicitly tell the server that I want you to allow this
specific query to run for 'n' seconds.
Hope its clear.
Message posted via http://www.droptable.com

How can i import the data from other database into SQL server ?

Hi,
i have developed an web-enabled student database application, where in i'll put all the details of the students from different universities.
while uploading the details of the students, i wanna just import the data given by the universities into the server.
I dont know how exactly the same could be done, also, since each university might be having there own format for the data, how can i import these into singe database?
Any ideas ... Please.Wink [;)]
Thanks in advance

Hi,
you can use DTS (Data Transformation Services) from Enterprise manager of Sql Server.
Regards
|||DTS is the way to go. If you have a standard your format, you can upload the file then launch the DTS package from your web page instead of having to upload the file then go to Ent Mgr, just simplifies things a bit. If that's what you are going to do, I'll provide VB code on how to launch the DTS pkg from you web page.|||Hey thanx,
i cant standardise the format since each university will have there own.And they all cant afford to give the data in the standard format.
anyways, do me the favour by providing me the code.If possible make it in C# since thats the one which i am coding with .
Also, can u plz give me an idea to how exactly i can standardise the format.
thanks in advance

Monday, February 27, 2012

How can I get the username from an application?

Hi everybody,

Here the environment is application in 3 layers.
So the user in his client machine, access the application in an application server that sends the request to my sql server database server.
My problem is: when I run sp_who from Query Analyzer, I see the host name that is pre-defined inside code application. But, actually, I need to know the user who is requesting the transactio so I can know right the person who is slowing my database performance...
Do you know, any function, procedure or anything else that I can use in the application code in order to provide the user or the host name from the client machine???
I hope some answers...

Thank you all,Look up NILADIC functions in Books Online.|||host_name()|||Hi all,

I have this doubt: may I apply SP3a in my SQL Server production database while it is operational?
I mean, may I do this version upgrade while the databases are online and users continue accessing the databases normally?
My actual version is 8.00.194 (no SP applied), and I am planning to apply SP3a.

Thank you in advance,|||No, when applying sp3a to a server that is currently at RTM (what you load from the CD) will require a reboot of Windows. There will be a brief service interruption while the machine reboots.

-PatP|||host_name()Will host_name() help in a three tier environment? I would expect it to return the name of the middleware server.

-PatP|||So this function host_name() doesn't help me, because I need to see the client host name during sp_who...
Does someone can explain a solution for this?

Thanks,|||The easiest way is to have your middleware set the hostname (http://support.microsoft.com/default.aspx?scid=kb;en-us;140301) equal to however it identifies the caller (user name, account number, etc). There are other ways to do this, but they get ugly very quickly and each solution is VERY specific to the installation/application involved.

-PatP

Sunday, February 19, 2012

How can I find out who is running dangerous queries

I recently discovered that some one (or application) updated all the
rows in the database. Looks like a query was missing a where clause.
It was probably one of the applications, but reviews of the code show
that a where clauses is always used, or so it appears. Anyway, I set
up a trigger to capture every update to a particular table that
recorded who did what and when. I created the trigger (on insert and
update) on a table and in it I use the new fn_get_sql function that
comes with SQL Server 2000 SP3. It looks like this:

----------
CREATE TRIGGER Update_Last_Modified ON [dbo].[MYTABLENAME]
FOR UPDATE, INSERT
AS
BEGIN
SET NOCOUNT ON
DBCC TRACEON (2861)

DECLARE @.Qry nvarchar(4000)

DECLARE @.handle binary(20)

SELECT @.handle = sql_handle
FROM master..sysprocesses
WHERE spid = @.@.SPID

SET @.QRY = (SELECT CONVERT(nvarchar(4000), [text]) FROM
::fn_get_sql(@.handle))

UPDATE MYTABLENAME
SET DATE_LAST_MODIFIED = GETDATE(),
LAST_COMMAND = @.QRY,
LAST_USER = SYSTEM_USER
FROM inserted
WHERE MYTABLENAME.UID= Inserted.UID
END

-----------

It was previously coded to use DBCC INPUTBUFFER, and it worked fine,
but I was limited to the first 255 characters of the command, which
prevented me from seeing the critical parts, like the where clause!
When I modified the trigger to use fn_get_sql, all I ever see is the
entire text of the create trigger command. Maybe I should use an
entirely different approach. I'm open to ideas.

Thanks very much in advance for your help!

Miles

_________________Miles (milesfeinberg@.hotmail.com) writes:
> It was previously coded to use DBCC INPUTBUFFER, and it worked fine,
> but I was limited to the first 255 characters of the command, which
> prevented me from seeing the critical parts, like the where clause!
> When I modified the trigger to use fn_get_sql, all I ever see is the
> entire text of the create trigger command. Maybe I should use an
> entirely different approach. I'm open to ideas.

Yes, the idea with fn_get_sql is to get the currently executing statement
of a procedure. And for a process that introspects itself, the current
statement will be the statement it queries sysprocesses. So in your
case DBCC INPUTBUFFER is a better bet.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp