Link to home
Start Free TrialLog in
Avatar of b001
b001Flag for Afghanistan

asked on

DataGridView Sql Table

Hi Experts
 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.ExecuteNonQuery()
          cmd.CommandText = "INSERT INTO FMSTEMP (COL1,COL2) VALUES (1245,'IDOX')"
        cmd.ExecuteNonQuery()
 
 I would like to show data form FMSTEMP table in DataGridView
 DataGridView1.DataSource = "FMSTEMP"
It doesn't work.
Please help
ASKER CERTIFIED SOLUTION
Avatar of srikanthreddyn143
srikanthreddyn143

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial