This is a multi-part message in MIME format
------=_NextPart_000_27621417
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Scott,
Thank you for your reply. Actually, I am looking for some way that on
the server query side, it will retrieve the right format of the data
since I am linking the dataset directly to the datagrid. On my html
part, I only have the following code:
<TD style="HEIGHT: 166px" colSpan="1"><asp:datagrid id="dg1"
runat="server" Width="706px" OnSortCommand="dgrdHistory_SortCommand"
AllowSorting="True" BackColor="WhiteSmoke">
<EditItemStyle Font-Names="Garamond"></EditItemStyle>
<HeaderStyle Font-Names="Garamond" Font-Bold="True"
ForeColor="Navy" BackColor="Gainsboro"></HeaderStyle>
</asp:datagrid></TD>
And then on my server side code, I am linking the result of the query to
a dataset and then linking to the datagrid. Like following:
dadHistory = New SqlDataAdapter("Select ExamID as 'Exam
Name',ExamDate as 'Exam Date',SiteID as 'Site Name',IdFunction as
'Function',SpecialAcco as 'Special Accommodation',CreateDate as 'Create
Date',ValidFlag as 'Approved',CheckNum as 'Check Number',CheckDate as
'Check Date' FROM UserHistory WHERE UserID = '" & Me.lblUserID.Text &
"'", con)
dadHistory.Fill(dstHistory, "UserHistory")
'bind dataset to datagrid
Me.dg1.DataSource = dstHistory
Me.dg1.DataBind()
con.Close()
And also some sorting program that will sort the datagrid by each
column's name. Since I have so many fields and only one date field is
not displaying correctly. I am trying to find an easy way of just get
the correct result from the query if possible so that all my other part
wont have to change. I am using SQL database but I couldnt find a
function to format the query result to "mm/dd/yyyy". If I have to format
the display on the html part, I will do it but I will need to rewrite a
lot of codes.
Any other thoughts?
Thanks.
Irene
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
------=_NextPart_000_27621417
Content-Type: text/html; name="_alt.0"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="_alt.0"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4=2E0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html;=
charset=3Diso-8859-1">
<META content=3D"MSHTML 6=2E00=2E2900=2E2523" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<P class=3DMsoNormal><SPAN style=3D"FONT-SIZE: 12pt"><FONT=
face=3DArial><FONT
size=3D2>Hi Steve, <?xml:namespace prefix =3D o ns =3D
"urn:schemas-microsoft-com:office:office"=
/><o:p></o:p></FONT></FONT></SPAN></P>
<P class=3DMsoNormal><SPAN style=3D"FONT-SIZE: 12pt"><FONT face=3DArial=
size=3D2>Just to
refresh your memory, this is what I put in the last=
posting:</FONT></SPAN></P>
<P class=3DMsoNormal><SPAN style=3D"FONT-SIZE: 12pt"></SPAN><SPAN
style=3D"FONT-SIZE: 12pt"><FONT face=3DArial size=3D2>Let's say I have=
the following
grid characteristics:<BR><BR>Slot =
Name Other
Info
Details &nbs=
p; &nb=
sp;
HiddenField<BR>1
Mike 38=
Years
LinkToDetailRecord  =
;
PrimaryKeyToDetailRecord<BR>2 =
Joe =
41
Years
LinkToDetailRecord  =
;
PrimaryKeyToDetailRecord<BR>3 =
Bob 23=
Years
LinkToDetailRecord  =
;
PrimaryKeyToDetailRecord<BR><BR><BR></FONT></P><o:p></o:p></SPAN>=
<P class=3DMsoNormal><SPAN style=3D"FONT-SIZE: 12pt"><FONT=
face=3DArial><FONT
size=3D2>Further Info=2E<BR>Slot is in the records for this dataset
(tblAdsToRun)=97just not in the detail records (tblAdvertisements)=2E=
Slot is
basically a column used by <BR>the display ad process=2E What I=
want here, is for
the administrator to be able to <BR>move the Bob record to slot 2=
where record
Joe is and then record Joe would be slot 3=2E In other <BR>words,=
select a row and
be able to move it up one or down one, with the slot <BR>numbers=
staying the
same=2E<o:p></o:p></FONT></FONT></SPAN></P>
<P class=3DMsoNormal><SPAN style=3D"FONT-SIZE: 12pt"><FONT=
face=3DArial><FONT
size=3D2>Now I have tried something different things and different=
approaches=2E=2E In
the GridUpdate event I allow the user to change the Slot and upon=
update I need
to write the database record back to the tblAdsToRun table=2E For=
me to get to the
right row, I need the PrimaryKey (a hidden field in the grid)=2E=
For some reason,
I cannot get that number from the grid=2E It just keeps showing up=
as blank (=93=94)=2E
Do you think I have something else going on here, or is it a fact=
that if the
field is visible=3Dfalse then you cannot access the hidden data=2E I=
am sure I have
done this before=2E Any suggestions?<BR>Thanks for your
help!<o:p></o:p></FONT></FONT></SPAN></P>
<P class=3DMsoNormal><FONT face=3DArial><FONT size=3D2><SPAN
style=3D"FONT-SIZE: 12pt">Michael</SPAN><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY:=
Arial"><o:p></o:p></SPAN></FONT></FONT></P>
<DIV class=3DMsoNormal><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY:=
Arial"><o:p> </o:p></SPAN></DIV>
<DIV class=3DMsoNormal><SPAN style=3D"FONT-SIZE: 10pt; FONT-FAMILY:=
Arial">Michael
D=2E Murphy</SPAN><o:p></o:p></DIV>
<DIV class=3DMsoNormal><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY:=
Arial">
Senior Software Architect</SPAN><o:p></o:p></DIV>
<DIV class=3DMsoNormal><SPAN style=3D"FONT-SIZE: 10pt; FONT-FAMILY:=
Arial">SCS Tech
Resources, Inc=2E</SPAN><o:p></o:p></DIV>
<DIV class=3DMsoNormal><SPAN style=3D"FONT-SIZE: 10pt; FONT-FAMILY:=
Arial">1400
Northwest 70 Way, <?xml:namespace prefix =3D st1 ns =3D
"urn:schemas-microsoft-com:office:smarttags" /><st1:address
w:st=3D"on"><st1:Street w:st=3D"on">Suite</st1:Street>
HO1</st1:address></SPAN><o:p></o:p></DIV>
<DIV class=3DMsoNormal><st1:place w:st=3D"on"><st1:City=
w:st=3D"on"><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY:=
Arial">Plantation</SPAN></st1:City><SPAN
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">, <st1:State
w:st=3D"on">FL</st1:State> <st1:PostalCode