MySQL with C#, from a PHP Developer's Standpoint -
I understand that with PHP I can use mysql_query ($ sql); And mysql_fetch_array ($ result); Get some MySQL data and keep it in an array. How is it achieved in C #, where I can say, keep my data in the datagrid?
This is probably the most specific ADO.NET code for filling the DataGrade Using:
DataTable results = new DataTable (); (MySqlConnection conn = new MySqlConnection (connString)) (MySqlCommand command = new MySqlCommand (sqlQuery, conn)) {MySqlDataAdapter adapter = new MySqlDataAdapter (command); Conn.Open (); Adapter.Fill (result); }} SomeDataGrid.DataSource = Results; SomeDataGrid.DataBind ();
Comments
Post a Comment