B
Bill
I am still new at this but I was quite surprised to find that I cannot make
a datatable object survive a repost!
I suppose I could populate and read back a datagrid but that seems messy.
how else can I do this?
Thanks
Bill
Dim cmd As SqlCommand
Dim con As SqlConnection
Dim da As New SqlDataAdapter
Dim dt As DataTable
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
constr =
Web.Configuration.WebConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString
con = New SqlConnection(constr)
If Not Page.IsPostBack Then
cmd = New SqlCommand("stp_GetExternalDest", con)
da.SelectCommand = cmd
da.SelectCommand.Parameters.AddWithValue("@int_CustomerId",
intCustomerID)
da.Fill(ds, "tblExternals")
dt = ds.Tables("tblExternals") '
this does not survive a postback !!!!!!!!!!
a datatable object survive a repost!
I suppose I could populate and read back a datagrid but that seems messy.
how else can I do this?
Thanks
Bill
Dim cmd As SqlCommand
Dim con As SqlConnection
Dim da As New SqlDataAdapter
Dim dt As DataTable
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
constr =
Web.Configuration.WebConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString
con = New SqlConnection(constr)
If Not Page.IsPostBack Then
cmd = New SqlCommand("stp_GetExternalDest", con)
da.SelectCommand = cmd
da.SelectCommand.Parameters.AddWithValue("@int_CustomerId",
intCustomerID)
da.Fill(ds, "tblExternals")
dt = ds.Tables("tblExternals") '
this does not survive a postback !!!!!!!!!!