D
D
Deka0072019-06-07 20:35:29
.NET
Deka007, 2019-06-07 20:35:29

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

3 answer(s)
D
Deka007, 2019-06-08
@Deka007

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);
            }

K
Konstantin Tsvetkov, 2019-06-07
@tsklab

sp_help

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question