| | |
SQl connectivity Problem
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
Hi
In my Project I used to connect to sql server2000,which is not in local computer.I use visual studio 2005 to develop the windows application.Once I run the apllication it gave me error message ,below I mention the error meassage I got
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections
* But sometime once I run the application it never gave me above error.Below I write sql connection part.
Please help me solve this problem
In my Project I used to connect to sql server2000,which is not in local computer.I use visual studio 2005 to develop the windows application.Once I run the apllication it gave me error message ,below I mention the error meassage I got
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections
* But sometime once I run the application it never gave me above error.Below I write sql connection part.
C# Syntax (Toggle Plain Text)
SqlConnection conn; public static SqlConnection getConnection(){ SqlConnection con=new SqlConnection("Data Source=Test_PP;Initial Catalog=Test_T;User ID=test;Password=test"); return con; } public static SqlDataReader getdatareader(string str){ SqlConnection conn = dbEngin.getConnection(); //logclass.WriteTOLOG(DateTime.Now.ToString() + '\t' + "Establish the Sql Database connectivity"); SqlConnection.ClearPool(conn); conn.Close(); //logclass.WriteTOLOG(DateTime.Now .ToString()+ '\t' + "Close the SQL connectivity"); conn.Open(); // logclass.WriteTOLOG(DateTime.Now.ToString()+ '\t' + "Open the SQL connectivity"); SqlCommand command = new SqlCommand(str, conn); // logclass.WriteTOLOG(DateTime.Now.ToString() + '\t'+ "Executing the SQL query"+str); return command.ExecuteReader(); }
Please help me solve this problem
Last edited by Tank50; Sep 18th, 2009 at 10:36 am.
Do you work on windows Vista?
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- facing problem in database connectivity in java to mysql (Java)
- SQL in VB.NET problem (VB.NET)
- Limited or no connectivity problem with linksys and comcast (Networking Hardware Configuration)
- Problem with php and SQL (PHP)
- Internet Connectivity Problem (Networking Hardware Configuration)
- SQL query problem with WHERE clause (ASP)
- SQL date problem (MS SQL)
Other Threads in the C# Forum
- Previous Thread: Add Items to Listview
- Next Thread: DateTime.. out_of_range
| Thread Tools | Search this Thread |
.net access algorithm array asp.net barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom database databaseconnection datagrid datagridview dataset datetime dbconnection degrees design development draganddrop drawing encryption enum event eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net httpwebrequest image index input install java label libraries list listbox loop mandelbrot marshalbyrefobject math mouseclick movingimage mysql mysql.data.client operator path photoshop picturebox pixelinversion platform post programming radians regex remote remoting resourcefile richtextbox server sleep socket sql statistics stream string system.servicemodel table tcpclientchannel text textbox thread time timer update usercontrol validation visualstudio webbrowser windows winforms wpf wpfc# xml






