Hi dude,
You can use ready to use data source in toolbox while you can use coding to work with SQL database too.
It's clear that by coding you will have more options to work with.
For coding have a look at the following code snippet in C#.Net:
private System.Data.DataSet ConnectAndQuery(string query)
{
System.Data.SqlClient.SqlDataAdapter objdataadapter = new System.Data.SqlClient.SqlDataAdapter();
System.Data.SqlClient.SqlCommand objsqlcommand = new System.Data.SqlClient.SqlCommand();
System.Data.SqlClient.SqlConnection objconnection = new System.Data.SqlClient.SqlConnection();
objconnection.ConnectionString = "Data Source=[SERVER NAME];Initial Catalog=[DATABASE NAME];Integrated Security=True;Pooling=False";
objdataadapter.SelectCommand = new System.Data.SqlClient.SqlCommand();
objdataadapter.SelectCommand.Connection = objconnection;
objdataadapter.SelectCommand.CommandText = query;
System.Data.DataSet objdataset = new System.Data.DataSet();
objconnection.Open();
objdataadapter.Fill(objdataset, "myresultTable");
objconnection.Close();
return objdataset;
}
use direction:
// It gets the filed[0,0] of table myTable in [DATABASE NAME] database
ConnectAndQuery("SELECT * FROM myTable").Tables["myresultTable"].
Rows[0].ItemArray[0].ToString()
good luck...