Posted on: 5/10/2011 10:27:31 AM | Views : 222

This is a snippit of code:
 
Sub Page_Load(ByVal s As Object, ByVal e As EventArgs) myconnection = New SqlConnection(Application("conn")) If Not Page.IsPostBack Then 'On Error Resume Next Load_Data() End If Dim Load_Data() conn.Open() mydatagrid.DataSource = ds mydatagrid.DataBind() conn.Close() End Sub Protected Sub PopulateDropDownList() SQL = "SELECT ID, FName + ' ' + LName As FullName FROM tbl WHERE ID = @intID AND Remove = @Remove ORDER BY FullName;--" ds = New DataSet() sda = New SqlDataAdapter(SQL, myconnection) sda.SelectCommand.Parameters.Add("@intID", 1) sda.SelectCommand.Parameters.Add("@Remove", 0) sda.Fill(ds, "Table1") 'Fill DataSet TempDataView = ds.Tables("Table1").DefaultView End Sub Public Sub Edit(ByVal s As Object, _ ByVal e As DataGridCommandEventArgs) 'Set the DataGrid row to edit mydatagrid.EditItemIndex = e.Item.ItemIndex ...

Go to the complete details ...