Answer the question
In order to leave comments, you need to log in
How to add data types from DB to combobox?
how to add list of db data types to combobox? I am implementing a query to add a column to a table. I want to select data type from the list via combobox like this:
@"Alter Table 'TableName' add"+textBox1.ToString()+ comboBox1.SelectedItem.ToString() + "NULL"
Answer the question
In order to leave comments, you need to log in
The topic is closed, I figured it out myself. did like this:
List<SqlDbType> types = new List<SqlDbType>();
foreach (SqlDbType item in Enum.GetValues(typeof(SqlDbType)))
{
types.Add(item);
}
SqlDbType[] list = types.ToArray();
foreach(var item in list)
{
comboBox1.Items.Add(item);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question