I want to bind grid using asp.net and vb.net. But unable to rename the column names in grid.
I want to bind grid using asp.net and vb.net. But unable to rename the column names in grid.
go to page_load events then write datagridview1.datasourse(datasourse,"scr") then write datagridview1.databind,
To bind the Grid in ASP.Net or VB. NET,
use follwing code in the calling event.
Dim ds as new Dataset
Dim adp as new SQLdataadapter("select * fromtablename", cn)
adp.fill(ds)
Datagridview1.datasource=ds.tables(0)
Datagridview1.databind()
To bind the Grid in ASP.Net or VB. NET,
use follwing example code in the calling event.
imports system.data.sqlclient
imports ssytem.data
dim cn as new sqlconnection("connection string")
Dim ds as new Dataset
Dim adp as new SQLdataadapter("select * from tablename", cn)
adp.fill(ds)
Datagridview1.datasource=ds.tables("scr")
Datagridview1.databind()
Please refer below site .
Good explanation is there...
How to Bind Data to a DataGrid Control Using ASP.Net and VB.Net - .Net Articles & Samples
Bookmarks