Hello all:
I hope I can make sense of this. I have exhausted all resources, MSDN and books, but cannot understand or figure how I can programmatically change and write out a different value of a datafield?
One of my datafields returns an on/off switch, (0,1), so depending on the value, I want to then output a string to that qualified datafield. Here is my codebehind:
here is the aspx:
Any ideas or help would be appreciated! Thank you!
I hope I can make sense of this. I have exhausted all resources, MSDN and books, but cannot understand or figure how I can programmatically change and write out a different value of a datafield?
One of my datafields returns an on/off switch, (0,1), so depending on the value, I want to then output a string to that qualified datafield. Here is my codebehind:
VB.NET:
Private Function TestDataSet()
Dim iMemberId As String = Request.QueryString("member_id")
Dim connString As String = ConfigurationManager.AppSettings("connectionstring")
Dim con As New SqlConnection(connString)
Dim sql As String = "SELECT rm.recip_id, rm.member_id, rm.mls_id, rm.agent_name, rm.office_name, rm.street_number + ' ' + rm.street_name + ' ' + rm.city + ',' + rm.state AS recip_address, " _
& "rm.expiration_date, rm.received_by, rm.fee, rm.payment_type, rm.check_number, rm.recip_to, rm.recip_date, rm.last_updated, " _
& "rm.recip_type, rm.recip_status, m.Office_Number " _
& "FROM callcenterdev..tRecipMaster rm WITH(NOLOCK) LEFT OUTER JOIN rapdata..Member m WITH(NOLOCK) ON rm.member_id = m.Member_Number " _
& "WHERE rm.member_id = '" & iMemberId & "' "
Dim objDataAdapter As New SqlDataAdapter(sql, connString)
Dim objDataSet As New DataSet()
Dim objConnect As New SqlConnection(connString)
objDataAdapter.Fill(objDataSet, "Recip")
grdResults.DataSource = objDataSet.Tables("Recip").DefaultView
grdResults.DataBind()
Return objDataSet
End Function
HTML:
<asp:GridView ID="grdResults" runat="server" Visible="False" AutoGenerateColumns="False" AllowPaging="True" PageSize="3" BorderWidth="1px" CellPadding="2" CellSpacing="2">
<Columns>
<asp:HyperLinkField HeaderText="View" NavigateUrl="/_MembersOnly/RecipListing/RecipListingForm.aspx"
Text="Listing In" DataNavigateUrlFields="recip_id" >
<ControlStyle CssClass="LinkNormal" />
<HeaderStyle HorizontalAlign="Center" />
</asp:HyperLinkField>
<asp:BoundField DataField="recip_to" HeaderText="To" />
<asp:BoundField DataField="recip_status" HeaderText="Status" />
<asp:BoundField DataField="agent_name" HeaderText="Agent" />
<asp:BoundField DataField="office_name" HeaderText="Office" />
<asp:BoundField DataField="recip_address" HeaderText="Address" />
<asp:BoundField DataField="mls_id" HeaderText="MLS #" />
<asp:BoundField DataField="recip_date" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Date Entered" HtmlEncode="False" />
<asp:BoundField DataField="last_updated" DataFormatString="{0:d}" HeaderText="Last Updated"
HtmlEncode="False" />
</Columns>
</asp:GridView>
Last edited by a moderator: