Dim con1 As New SqlConnection(ConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString) con1.Open() Dim ada1 As New SqlDataAdapter("P_FN_PR_PopGrid", con1) Dim ds1 As New DataSet Try ada1.SelectCommand.CommandType = CommandType.StoredProcedure ada1.SelectCommand.Parameters.Add(New SqlParameter("@date", SqlDbType.DateTime)).Direction = ParameterDirection.Input ada1.SelectCommand.Parameters("@date").Value = Trim(RadDatePick.SelectedDate.Value) ada1.SelectCommand.Parameters.Add(New SqlParameter("@sc", SqlDbType.Char)).Direction = ParameterDirection.Input ada1.SelectCommand.Parameters("@sc").Value = Trim(ddlSc.SelectedValue) ada1.SelectCommand.Parameters.Add(New SqlParameter("@me", SqlDbType.Char)).Direction = ParameterDirection.Input ada1.SelectCommand.Parameters("@me").Value = Trim(ddlme.SelectedValue) ada1.Fill(ds1, "P_FN_PR_PopGrid") ada1.Dispose() If (Not IsNothing(Session("NewRec"))) Then Dim lst As List(Of Rec) = TryCast(Session("NewRec"), List(Of Rec)) For Each rec As Rec In lst Dim rw As DataRow = ds1.Tables(0).NewRow() rw("port_rec_num") = rec.port_rec_num rw("DESC_ALT") = rec.DESC_ALT rw("port_no_se") = rec.port_no_se rw("STD_NUM_OF_SE") = rec.STD_NUM_OF_SE ds1.Tables(0).Rows.InsertAt(rw, 0) Next End If GD_Prod.DataSource = ds1.Tables(0).DefaultView GD_Prod.DataBind() Catch Err As Exception Response.Write(Err.Message.ToString) Finally con1.Close() End Try Session.Remove("NewRec") End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)