hi
i'm doing a program in c# asp.net..i have to retrievee some data from database and display in a grid..and then there is a textbox where i've to enter the reg no of a vehicle..once i enter the no and click the button the speed and ignition of the vehicle must be displayed in the other two text boxes..the first part i 've completed that is till retrieving data..i need the code for the button click event..please help....
my code so far
protected void Page_Load(objec t sender, EventArgs e)
{
GridCon.Open();
SqlDataAdapter MyDa = new SqlDataAdapter( "select REGISTRATIONNO, UNIT_NO,SPEED,G PS_DATETIME,LAT ITUDE from GPSDATA where datediff(mi,gps data.GPS_DATETI ME,getdate())<3 0", GridCon);
DataSet MyDs1 = new DataSet();
MyDa.FillSchema (MyDs1, SchemaType.Sour ce, "gpsdata");
MyDa.Fill(MyDs1 .Tables["gpsdata"]);
DataTable MyDT = new DataTable();
GridView1.DataS ource = MyDs1;
GridView1.DataB ind();
}
protected void Button1_Click(o bject sender, EventArgs e)
{
//i need code for this
}
thanking you
i'm doing a program in c# asp.net..i have to retrievee some data from database and display in a grid..and then there is a textbox where i've to enter the reg no of a vehicle..once i enter the no and click the button the speed and ignition of the vehicle must be displayed in the other two text boxes..the first part i 've completed that is till retrieving data..i need the code for the button click event..please help....
my code so far
protected void Page_Load(objec t sender, EventArgs e)
{
GridCon.Open();
SqlDataAdapter MyDa = new SqlDataAdapter( "select REGISTRATIONNO, UNIT_NO,SPEED,G PS_DATETIME,LAT ITUDE from GPSDATA where datediff(mi,gps data.GPS_DATETI ME,getdate())<3 0", GridCon);
DataSet MyDs1 = new DataSet();
MyDa.FillSchema (MyDs1, SchemaType.Sour ce, "gpsdata");
MyDa.Fill(MyDs1 .Tables["gpsdata"]);
DataTable MyDT = new DataTable();
GridView1.DataS ource = MyDs1;
GridView1.DataB ind();
}
protected void Button1_Click(o bject sender, EventArgs e)
{
//i need code for this
}
thanking you
Comment