Hi munish
Actually you haven't explained your problem properly but what i got is You have one DataGrid or Gridview in which u created on linkButton for ur information i would like to tell u that, Link Button and Push Button works with similar way. I have written one code bellow for Edit Button you can refer it
'1) EDIT OPERATION
Private Sub DataGrid1_EditCommand(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles Datagrid1.EditCommand
Datagrid1.EditItemIndex = e.Item.ItemIndex
TextBox3.Text = e.Item.Cells(0).Text
Dim cn1 As New OleDb.OleDbConnection()
cn1.ConnectionString= "Provider=SQLOLEDB.1;Password=whiteeagle;Persi st Security Info=True;User ID=sa;Initial Catalog=gtport;Data Source=GIS1;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=GIS3;Use Encryption for Data=False;Tag with column collation when possible=False"
Dim sql1 As String
sql1 = "select id,materialtype_desc,packingtype_desc,item_descrip tion,actual_wt,quantity,rate,amount,declared_value ,declared_wt from tmp_mtran_b where sess_id ='" & Session.SessionID & "'"
Dim cmd1 As New OleDb.OleDbCommand(sql1, cn1)
Dim adpt1 As New OleDb.OleDbDataAdapter(cmd1)
Dim ds1 As New DataSet()
adpt1.Fill(ds1, "tmp_mtran_b")
Datagrid1.DataSource = ds1.Tables("tmp_mtran_b")
Datagrid1.DataBind()
cn1.Open()
cmd1.ExecuteNonQuery()
cn1.Close()
Datagrid1.Focus()
End Sub
##########Use this code with proper datagrid name .... i know this will surly help u out..
Good Luck
Regards
AMOL
Amol Chikurte
|