getschematable

how do we get the Column Size and dataType from getschemaTable?

坚强是说给别人听的谎言 提交于 2019-12-12 14:42:35
问题 I am a newbie and I am trying to retrieve the Column NAme , Size ( max legth ) and DataType from some table in my database , the following code when i execute it expecting it to display all the column types and names ( i didn't find how to refer to the Size , i used ColumnSize but it is said that DataColumn does not contain a definition for this method ) but when executing it , it only displays : IsColumnSetSystem.Boolean this is the code : private void button1_Click(object sender, EventArgs

How to get the DataType and Size of a column using the SqlDataReader?

元气小坏坏 提交于 2019-12-12 11:43:08
问题 i am trying to get the data type of each column given to do some verification i already tried the getSchemaTable but it only gives me the schema of a table without values. For example , i have a table in my database and a columnname : id_declarant . I want to retrieve the datatype and Size of a value from id_declarant . Here is The code : comm.Connection=new SqlConnection(connectionString); String sql = @" SELECT * FROM id_declarant,declarant WHERE (declarant.Nom_pren_RS='" + textBox1.Text +