I have a database which has a column of type VARCHAR(30). I want to insert a string into this column using ADO .net. I first want to make sure that the string will be able to fit into the column in the database. If it can fit, I will insert the whole string. If not, I will truncate the string so that it will fit.
If I read the desired table into an SqlDataAdapter and then fill a dataTable, there is a property in dataTable.Colum ns.Item("Column ") called MaxLength, but it always returns -1.
I want to use some method that will return 30. Any ideas?
If I read the desired table into an SqlDataAdapter and then fill a dataTable, there is a property in dataTable.Colum ns.Item("Column ") called MaxLength, but it always returns -1.
I want to use some method that will return 30. Any ideas?
Comment