Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 SQL server 2008 on Virtual PC

Author  Topic 

ahsan2011
Starting Member

1 Post

Posted - 2010-09-15 : 17:07:28
HI ALL

i hav a sql server 2008 on virtual pc.

host is windows 7 ultmate...visual webdeveloper is on windows 7.

m trying to connect to sql but cant connect.
im able to ping it..firewall is on..
both the ips are in same subnet.
m tryin to access a database table
getting the following error
"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. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

My asp.net codes are on button click
"SqlConnection con = new SqlConnection("server=(AHSAN-709758AC4);database=Mobily;Integrated Security=SSPI");
SqlDataAdapter da = new SqlDataAdapter("select * from data", con);
DataSet ds = new DataSet();
da.Fill(ds,"data");
Repeater1.DataSource = ds.Tables["data"];
Repeater1.DataBind();
"
m getting a error on da.fill statement
   

- Advertisement -