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 2005 Forums
 Other SQL Server Topics (2005)
 Connection.Open Problem ?

Author  Topic 

oguzkaygun
Yak Posting Veteran

53 Posts

Posted - 2009-01-18 : 08:44:41
hello

when i create *.mdf from visual studio, i below code in web.config.. and it runs.. but i cant see my *.mdf in SQL management Studio

<connectionStrings>

<add name="kategorilerCS" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\kategoriler.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

</connectionStrings>

When i create *.mdf from SQL Management Studio, i can see *.mdf at VS2008 and SQL management studio.. i have added below code for web.config.. but it doesnt run at page.aspx.. it give me error that line is sqlCmd.Connection.Open().. What can be problem ? what should i do ?

Dim conn As String = ConfigurationManager.ConnectionStrings("urunlerCS").ConnectionString

Dim mySqlConn As New SqlConnection(conn)




<connectionStrings>

<add name="urunlerCS" connectionString="Data Source=.\\sqlexpress;database=urunler; integrated security=true;User Instance=True" providerName="System.Data.SqlClient"/>

</connectionStrings>

oguzkaygun
Yak Posting Veteran

53 Posts

Posted - 2009-01-18 : 09:23:26
i have solved this problem with below
<add name="urunlerCS" connectionString="Data Source=.\sqlexpress;Initial Catalog=urunler;Integrated Security=True"
providerName="System.Data.SqlClient" />
Go to Top of Page
   

- Advertisement -