This is a migrated thread and some comments may be shown as answers.

Problem to fill datagrid by using OleDbConnection

2 Answers 26 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 27 Apr 2011, 01:10 PM
Hello
I use this code to fill datagrid , but rows was created without data! whats the problem?
Dim connString As String = "Provider=SQLOLEDB.1;Password=*******;Persist Security Info=True;User ID=sa;Initial Catalog=chek;Data Source=ahnd"
        Dim myConnection As OleDbConnection = New OleDbConnection
        '192.168.168.1
        'Data Source=ahnd;Initial Catalog=chek;Persist Security Info=True;User ID=sa
        myConnection.ConnectionString = connString
        Dim da As OleDbDataAdapter = New OleDbDataAdapter("select * from x" , myConnection)
        Dim ds As DataSet = New DataSet
        da.Fill(ds, "x")
        RadGridView1.DataSource = ds.Tables("x").DefaultView

2 Answers, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 29 Apr 2011, 02:00 PM
Hello Ali,

Please check your resulting data set / data table for data before setting it as a data source to the grid. If the grid loads columns correctly i don't believe that there is a problem with the grid, in my point of view the problem is coming from the query itself.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga

Telerik WinForms MVP
0
Ali
Top achievements
Rank 1
answered on 29 Apr 2011, 09:18 PM
Hello
I change my radgrid properties to default and problem solved.
Thank u. 
Tags
GridView
Asked by
Ali
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Ali
Top achievements
Rank 1
Share this question
or