| Read from a table in a database |
|
|
|
|
ASPX.CS C# - How to read from a table in a database SqlConnection conn = new SqlConnection("..."); conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = "SELECT Description, Position FROM TableName"; SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { Desc = Convert.ToString(dr["Description"]); Pos = Convert.ToDouble(dr["Position"]); ... } dr.Close(); conn.Close()
Only registered users can write comments. Powered by AkoComment 2.0.3! |
||
| Last Updated ( Friday, 27 October 2006 ) | ||
| < Prev | Next > |
|---|



Articles 




