Get database table structure

xiaoxiao2021-03-06  37

DataSet ds = new DataSet (); System.Data.SqlClient.SqlConnection cnn = new System.Data.SqlClient.SqlConnection ( "server = (local); database = northwind; trusted_connection = yes"); cnn.Open (); System .Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand (); cmd.Connection = cnn; cmd.CommandText = "Select * from PersonDetails where 1 <> 1"; System.Data.SqlClient.SqlDataReader dr = CMD.ExecuteReader (System.data.commandbehavior.CloseConnection); this.dataGrid1.datasource = Dr.getschematable (); cnn.close (); Dr.Close ();

转载请注明原文地址:https://www.9cbs.com/read-118609.html

New Post(0)