how do i connect to a sql server database on godaddy in asp.net?

Posted on Dec 29, 2008 under GoDaddy.com | 3 Comments

this is what i have so far:

Dim cn As New System.Data.SqlClient.SqlConnection("Data Source=whsql-v20.prod.mesa1.secureserver.net; Initial Catalog=janeric; User ID=janeric; Password='insertpassword';")<br/>
cn.Open()<br/>
Dim cmd As Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand("insert into products (id, name, price, description, count, pictureadd, artist, catergory) values ('1','nothing','5000.00','sdfasdf','1','lithographs/african lion.png','stobart','animal');", cn)<br/>
Dim sqlrdr As Data.SqlClient.SqlDataReader = cmd.ExecuteReader(Data.CommandBehavior.Default)<br/>
Dim adapter As New System.Data.SqlClient.SqlDataAdapter()
adapter.SelectCommand = New Data.SqlClient.SqlCommand("select * from products", cn)</br>
Dim ds As New Data.DataSet<br/>
adapter.Fill(ds)<br/>
datagrid1.DataSource = ds<br/>
datagrid1.DataBind()<br/>
cn.Close()<br/>
<br/>
<br/>

3 Responses to “how do i connect to a sql server database on godaddy in asp.net?”

  1. rexecampbell Says:

    not sure what you are asking but the source should be an ip address (it just works better, Here is a link to help you write the connections.

    For ADO:
    http://www.carlprothman.net/Default.aspx?tabid=86#SQLClientManagedProvider

    For ASP.Net:
    http://www.asp101.com/Samples/db_edit_aspx.asp

    I hope that gives you the information you are looking for!

  2. Christmas Tree…

    That is really fascinating, You’re an excessively professional blogger. I’ve joined your feed and sit up for looking for extra of your great post. Also, I have shared your website in my social networks! Christmas Tree …

  3. … [Trackback] …

    [...] Read More here: getportals.com/2008/12/29/how-do-i-connect-to-a-sql-server-database-on-godaddy-in-aspnet/ [...] …

Leave a Reply