How to get the SqlType of a column in a DataTable?

前端 未结 7 478
予麋鹿
予麋鹿 2020-12-31 01:45

I have a DataTable obtained from a SQL DataBase, like this:

using (SqlCommand cmd = new SqlCommand(query, _sqlserverDB))
{
    using (SqlDataAdapter adapter          


        
7条回答
  •  余生分开走
    2020-12-31 01:59

    As David says ... you are in .NET so the types will be .NET types. This is a listing of type mappings from SQL Server to .Net that shows you what .NET type you will end up with for a given Sql column type .. hope this helps ..

    http://msdn.microsoft.com/en-us/library/ms131092.aspx

提交回复
热议问题