connectivity

Posted by Pankaj.dhingra07 under ASP.NET on 10/13/2008 | Views : 1426 | Status : [Member] | Replies : 3
please tell me connectivity of the dot net with the sql with code and the type of the connectivity.

Please provide me the code for both the connectivities


Thanks!!




Responses

Posted by: Bubbly on: 2/18/2010 [Member] Bronze

Up
0
Down
Hello,

check this link

http://msdn.microsoft.com/en-us/library/ms998300.aspx

++
Thanks & Regards,
Deepika

Pankaj.dhingra07, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: perfectchourasia-9163 on: 11/17/2011 [Member] Starter | Points: 25

Up
0
Down
in the webconfig Define connection string

<appSettings>
<add key="linkbuilding" value="server=.;database=linkbuilding; uid=sa;pwd=sa123;"/>
</appSettings>



public void binddaashboard()
{
string query = "select * from commontask ";
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["linkbuilding"].ToString().Trim());
SqlCommand da = new SqlCommand(query, con);
SqlDataAdapter cmd = new SqlDataAdapter(da);
DataTable ds = new DataTable();
cmd.Fill(ds);
if (ds.Rows.Count > 0)
{
Deletetask.DataSource = ds;
Deletetask.DataBind();
}
else
{
ShowNoResultFound(ds, Deletetask);

}

}

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

Pankaj.dhingra07, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Majith on: 10/13/2008 [Member] Starter

Up
0
Down
hi Pankaj,

Refer the below answer ,

http://www.dotnetfunda.com/questions/question199.aspx

Pankaj.dhingra07, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response