connection string problem
-
im using vs2003 and sql2000 im getting error in connection string..... Keyword not supported: 'use procedure for prepare'. Line 51: { Line 52: string str= "select * from table1"; Line 53: SqlConnection cnn=new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;Use Procedure for Prepare=1;Packet Size=4096;Workstation ID=NETZOOM;Use Encryption for Data=false;Tag with column collation when possible=False"); Line 54: SqlCommand cmd=new SqlCommand(str,cnn); Line 55: DataSet ds=new DataSet();
SqlConnection cnn=new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;Use Procedure for Prepare=1;Packet Size=4096;Workstation ID=NETZOOM;Use Encryption for Data=false;Tag with column collation when possible=False");
i tried by removing that keywords still this error Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
modified on Tuesday, December 1, 2009 6:46 AM
Just remove Use Procedure for Prepare=1; from the connectionstring. Refer to www.connectionstrings.com[^] for writing your connectionstring.
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
im using vs2003 and sql2000 im getting error in connection string..... Keyword not supported: 'use procedure for prepare'. Line 51: { Line 52: string str= "select * from table1"; Line 53: SqlConnection cnn=new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;Use Procedure for Prepare=1;Packet Size=4096;Workstation ID=NETZOOM;Use Encryption for Data=false;Tag with column collation when possible=False"); Line 54: SqlCommand cmd=new SqlCommand(str,cnn); Line 55: DataSet ds=new DataSet();
SqlConnection cnn=new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;Use Procedure for Prepare=1;Packet Size=4096;Workstation ID=NETZOOM;Use Encryption for Data=false;Tag with column collation when possible=False");
i tried by removing that keywords still this error Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
modified on Tuesday, December 1, 2009 6:46 AM
If i'm not wrong you will only need this part of your connection string to connect to the database
"Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;"
All other information is not necessary. Just try with this! I would also suggest you to use Server Explorer to connect to the database to test the connectivity. You have a wizard there to help you and at the end of it you can get the connection string from the registered server's properties. -
If i'm not wrong you will only need this part of your connection string to connect to the database
"Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;"
All other information is not necessary. Just try with this! I would also suggest you to use Server Explorer to connect to the database to test the connectivity. You have a wizard there to help you and at the end of it you can get the connection string from the registered server's properties. -
i tried actually this is the error im getting... Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Try to manually register the server on the Server Explorer to connect to the database to test the connectivity. You have a wizard there to help you and at the end of it you can get the connection string from the registered server's properties. BTW, are you sure if Windows authentication is enabled on the database?
-
Try to manually register the server on the Server Explorer to connect to the database to test the connectivity. You have a wizard there to help you and at the end of it you can get the connection string from the registered server's properties. BTW, are you sure if Windows authentication is enabled on the database?
-
Dinesh Mani wrote:
Try to manually register the server on the Server Explorer
i did it and connection is successful there... but still same error....
Dinesh Mani wrote:
are you sure if Windows authentication is enabled
windows authentication is enabled..
Did you check the resultant connection string from the Server registration? You can get it by accessing the properties of the server. Try using that from your code. If possible try to generate a dataset/datatable using the Visual Studio wizards and check if you are able to connect and fetch data from the code.
-
i tried actually this is the error im getting... Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
So, is 'NT AUTHORITY\NETWORK SERVICE' listed in SQL Management Studio as one of the users with access to the database? I guess not.
If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles] [My Website]
-
i tried actually this is the error im getting... Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
-
im using vs2003 and sql2000 im getting error in connection string..... Keyword not supported: 'use procedure for prepare'. Line 51: { Line 52: string str= "select * from table1"; Line 53: SqlConnection cnn=new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;Use Procedure for Prepare=1;Packet Size=4096;Workstation ID=NETZOOM;Use Encryption for Data=false;Tag with column collation when possible=False"); Line 54: SqlCommand cmd=new SqlCommand(str,cnn); Line 55: DataSet ds=new DataSet();
SqlConnection cnn=new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;Use Procedure for Prepare=1;Packet Size=4096;Workstation ID=NETZOOM;Use Encryption for Data=false;Tag with column collation when possible=False");
i tried by removing that keywords still this error Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
modified on Tuesday, December 1, 2009 6:46 AM
Good Day i can Help. First your Connection is not Correct it has to be done this way
SqlConnection cnn=new SqlConnection("Initial Catalog=new;Data Source=NETZOOM;Initial Catalog=NETZOOM User ID=sa;Password=mypassword");
now here is the Problem you might not have a sa password. I see above you want to use WindowsAuthontication. Create a SQL Account and use it for your Application.
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
-
So, is 'NT AUTHORITY\NETWORK SERVICE' listed in SQL Management Studio as one of the users with access to the database? I guess not.
If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles] [My Website]
try to get the connexion string from the database properties and test it then put it in your code :zzz: