SqlDataAdapter
Diagram:
Steps:
Example: private void button1_Click(object sender, EventArgs e) { SqlConnection con; SqlDataAdapter adapter ; DataSet ds = new DataSet(); try { //create connection object con = new SqlConnection("connetionString"); //create query string(SELECT QUERY) String query="SELECT * FROM SOMETABLE WHERE..."; con.Open(); //Adapter bind to query and connection object adapter = new SqlDataAdapter(query, con); //fill the dataset adapter.Fill(ds); } catch (Exception ex) { con.Close(); } } Result: Your DataSet contains the result table of SELECT query. You can play around the table and its data. Happy Learning...
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: