Geeks With Blogs
Jeremy Ramos Resource blog (C# | ASP.NET | VB | WPF | WSDL | SQL | SharePoint | InfoPath | SSRS | SSIS) October 2008 Entries
Binding data controls with datasets using SqlDataAdapter
SqlDataAdapter Use this data adapter object to bind SQL data sources. Using SqlDataAdapter Object Using System.Data.OleDb; // do not forget your namespace ------------------------------ Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt ......

Posted On Thursday, October 30, 2008 10:16 AM

Binding data with SqlDataReader or OleDbDataReader
SqlDataReader Use this datareader object to bind SQL data sources. Using SqlDataReader Object Using System.Data.SqlClient; // do not forget your namespace ------------------------------ SqlConnection conn = new SqlConnection(connectionStr... conn.Open(); SqlCommand comm = new SqlCommand("select * from [My_Table]",conn); comm.CommandType = CommandType.Text; SqlDataReader dr = comm.ExecuteReader(); while (dr.Read()) { TextBox1.Text = (string)dr["info"].ToString(); //datareader object accepts 2 overloads ......

Posted On Thursday, October 30, 2008 9:51 AM

Copyright © Jeremy Ramos | Powered by: GeeksWithBlogs.net