
08/03/2005, 08:06
|
 | | | Fecha de Ingreso: febrero-2005
Mensajes: 539
Antigüedad: 20 años, 2 meses Puntos: 1 | |
sigiendo con los milagros de la programcion te he visto otra en tu codigo,como coge el strSql del metodo valor alguno?????
define el metodo asi
BindGrid(strSql as string)
y cdo le llames llamalo :BindGrid(strSql)
kedaria asi
Sub Bind (GridstrSql as string)
'----- Dim strSql As String----esto kitalo lo demas igual
Dim ds As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
MyConnection = New SqlConnection("SERVER=MDS01; DATABASE=be; INTEGRATED SECURITY=false;PASSWORD=sa;USER=sa")
MyCommand = New SqlDataAdapter(strSql, MyConnection)
ds = new DataSet()
MyCommand.Fill(ds, "Agencia")
MyDataGrid.DataSource=ds.Tables("Agencia").Default View
MyDataGrid.DataBind()
end sub
asi en cada momento le pasas la consulta quieras q te enlace |