E
Eric Smith
I am trying to learn about web based data access in .NET.
I would like to take the output of a simple parameter
based query and display it as editable on a webform (I
think). What is the best approach to this so that I can
have design time field level drag-and-drop?
Currently I am using the following but I have to manually
edit the fields onto the page. And it does not seem as
scaleable and elegant as it all should be. I really do
not want to use a grid control as I want a very
customized layout.
What is the "best" way to do this?
Dim DBConn As OleDbConnection
Dim DBCommand As OleDbDataAdapter
Dim DSPageData As New DataSet
Dim I As Integer
Dim J As Integer
Dim TempID As String
Dim xGUID As String
If (Me.IsPostBack) Then
Return
End If
xGUID = Request.QueryString("xGUID")
'xGUID = "27375757"
DBConn = New OleDbConnection
("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\data\msd.mdb;Mode=Share Deny None")
DBCommand = New OleDbDataAdapter("Select * From
MessageScreenConfigurationForm Where xGUID= '" & xGUID
& "'", DBConn)
DBCommand.Fill(DSPageData, "Forms")
Me.Session("DataSet") = DSPageData
With DSPageData.Tables("Forms").Rows(0)
Me.txtGUID.Text = .Item("xGUID") & ""
Me.txtOrgName.Text = .Item("OrgName") & ""
Me.txtContactName.Text = .Item("ContactName")
& ""
Me.txtAddress.Text = .Item("Address1") & ""
Me.txtAddress2.Text = .Item("Address2") & ""
Me.txtCity.Text = .Item("City") & ""
Me.txtState.Text = .Item("State") & ""
Me.txtZip.Text = .Item("Zip") & ""
Me.txtCountry.Text = .Item("Country") & ""
Me.txtPhone.Text = .Item("Phone") & ""
Me.txtEmailAddress.Text = .Item
("EmailForContact") & ""
End With
DBConn.Close()
I would like to take the output of a simple parameter
based query and display it as editable on a webform (I
think). What is the best approach to this so that I can
have design time field level drag-and-drop?
Currently I am using the following but I have to manually
edit the fields onto the page. And it does not seem as
scaleable and elegant as it all should be. I really do
not want to use a grid control as I want a very
customized layout.
What is the "best" way to do this?
Dim DBConn As OleDbConnection
Dim DBCommand As OleDbDataAdapter
Dim DSPageData As New DataSet
Dim I As Integer
Dim J As Integer
Dim TempID As String
Dim xGUID As String
If (Me.IsPostBack) Then
Return
End If
xGUID = Request.QueryString("xGUID")
'xGUID = "27375757"
DBConn = New OleDbConnection
("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\data\msd.mdb;Mode=Share Deny None")
DBCommand = New OleDbDataAdapter("Select * From
MessageScreenConfigurationForm Where xGUID= '" & xGUID
& "'", DBConn)
DBCommand.Fill(DSPageData, "Forms")
Me.Session("DataSet") = DSPageData
With DSPageData.Tables("Forms").Rows(0)
Me.txtGUID.Text = .Item("xGUID") & ""
Me.txtOrgName.Text = .Item("OrgName") & ""
Me.txtContactName.Text = .Item("ContactName")
& ""
Me.txtAddress.Text = .Item("Address1") & ""
Me.txtAddress2.Text = .Item("Address2") & ""
Me.txtCity.Text = .Item("City") & ""
Me.txtState.Text = .Item("State") & ""
Me.txtZip.Text = .Item("Zip") & ""
Me.txtCountry.Text = .Item("Country") & ""
Me.txtPhone.Text = .Item("Phone") & ""
Me.txtEmailAddress.Text = .Item
("EmailForContact") & ""
End With
DBConn.Close()