DataGridView Sql Table
Posted on 2011-02-26
I created a temporary Sql table and inserted some data into it using the following code
Dim cmd As SqlCommand = New SqlCommand()
cmd.Connection = cn
cmd.CommandText = "Create Table FMSTEMP (col1 int, col2 nvarchar(20))"
cmd.CommandText = "INSERT INTO FMSTEMP (COL1,COL2) VALUES (1245,'IDOX')"
I would like to show data form FMSTEMP table in DataGridView
DataGridView1.DataSource = "FMSTEMP"
It doesn't work.