Retrieving data types from database

G

Guest

Hi, I have the following problem:

I want to retrieve SQL data type of every column from database (means I want
to retrieve bigint, varchar(20) etc. instead of System.Int32, System.String
etc). I've written the following code:

string[] datatype = new string [100];
int i=0;

foreach (DataColumn column in myDataTable.Columns)
{
i++;
datatype = column.DataType.ToString();
}

but this code retrieves C# data types, i.e System.Int32, System.String and
so on.

Anyone can help me with some tips?
 
C

chanmm

As long as the data is accurate and you can update the data correctly. What
is the issue?

chanmm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top