Public Sub New()
'
' TODO: Add constructor logic here
'
Try
Dim connectionString As String = ConfigurationManager.ConnectionStrings("sqlConnection").ConnectionString
SqlCon = New SqlConnection(connectionString)
Catch ex As Exception
Throw New Exception(ex.Message)
Do more google search to get to understand how to connect from asp.net to SQL....you may need to use words SqlConnection, SqlCommand or may be SqlDataSource etc...
ramesh.radam
Member
56 Points
85 Posts
how to establish a connecton between a application and database
Feb 24, 2012 02:18 PM|LINK
Hello can anybody tell me the steps to create a connection between applicaton to database in( C# and sql server2005 )
suggest me to write code methods a simple example application
Thank you
kartheek1307
Member
152 Points
110 Posts
Re: how to establish a connecton between a application and database
Feb 24, 2012 02:23 PM|LINK
first in webconfig..
<connectionStrings>
<add name="sqlConnection" connectionString="Data Source=YOUR SERVERNAME;Initial Catalog=YOUR DB NAME;Integrated Security=True" />
</connectionStrings>
in connection.vb
Public Sub New()
'
' TODO: Add constructor logic here
'
Try
Dim connectionString As String = ConfigurationManager.ConnectionStrings("sqlConnection").ConnectionString
SqlCon = New SqlConnection(connectionString)
Catch ex As Exception
Throw New Exception(ex.Message)
End Try
End Sub
ramiramilu
All-Star
97799 Points
14494 Posts
Re: how to establish a connecton between a application and database
Feb 24, 2012 04:03 PM|LINK
http://www.beansoftware.com/ASP.NET-Tutorials/ASP.NET-SQL-Server.aspx
Do more google search to get to understand how to connect from asp.net to SQL....you may need to use words SqlConnection, SqlCommand or may be SqlDataSource etc...
Thanks,
JumpStart
ramesh.radam
Member
56 Points
85 Posts
Re: how to establish a connecton between a application and database
Feb 24, 2012 07:35 PM|LINK
Hai
Hello Ramiramilu
a wonderful URL that is forwared to me :i was gone throw it is very good and exterdinary message and easy to undestand.
Thank you