HI,
Don't know if this would help, but here is a portion of a class that i have
used before. You can adapt to your needs. and you can call the method what
ever you need, passing what ever values.
internal void GetControlValue(DataRow row, DataColumn dataColumn, string
value, bool required, List<stringErrorList)
{
if (string.IsNullOrEmpty(value) && dataColumn.AllowDBNull)
row[dataColumn] = DBNull.Value;
else
{
if (dataColumn.DataType == typeof(string))
{
row[dataColumn] = value;
}
else if (dataColumn.DataType == typeof(int))
{
row[dataColumn] = int.Parse(value);
}
else if (dataColumn.DataType == typeof(decimal))
{
row[dataColumn] = decimal.Parse(value);
.....
.....
.....
Robert
"cashdeskmac" <ca*********@discussions.microsoft.comwrote in message
news:D9**********************************@microsof t.com...
Hi,
I understand that in VB6 there was a command that let you poll the
database
and get the types of the columns (or something similar). I haven't worked
in
this language so I am not sure about it, but would anyone know if there is
something similar in C#?
My idea is to create a data access layer and would like to just pass in
strings for the parameters and let the data access layer take care of all
conversions.
Does anyone know if this is possible?