T
tshad
I have a datagrid that has objects that are not visible and I need to use
them in my Sql Statement.
The problem is they are not there when set as "visible=false", but they are
if set to true.
For example:
I have:
*****************************************************************************************
<asp:BoundColumn DataField="Answer"
HeaderText="Answer"></asp:BoundColumn>
<asp:BoundColumn DataField="PositionID" visible="false"
HeaderText="PositionID"></asp:BoundColumn>
<asp:BoundColumn DataField="QuestionUnique"
visible="false" HeaderText="QuestionUnique"></asp:BoundColumn>
<asp:BoundColumn DataField="AnswerUnique" visible="false"
HeaderText="AnswerUnique"></asp:BoundColumn>
*******************************************************************************************
Where only "Answer" is visible - the others are key fields that I need for
my Sql and don't really want them displayed.
In my update routine:
******************************************************************************************
Sub DataUpdate(S as Object, E as DataGridCommandEventArgs)
Dim oGrid as DataGrid = CType(S, DataGrid)
oGrid.EditItemIndex=Cint(E.Item.ItemIndex)
dim pc as TextBox = e.item.Cells(1).controls(0)
dim quc as TextBox = e.Item.Cells(2).controls(0)
dim auc as TextBox = e.Item.Cells(3).controls(0)
dim txtAnswer as TextBox=E.Item.Cells(0).Controls(0)
Dim sQuery as String = "SELECT TOP 6
Answer,PositionID,QuestionUnique,AnswerUnique from ScreenAnswers where
PositionID = '" & pc.text & "' and QuestionUnique = '" & quc.text & "'"
******************************************************************************************
This works fine if "pc", "quc" and "auc" have visibility set to true.
Then sQuery = Update ScreenAnswers set Answer = 'Oracle' where PositionID
= '' and QuestionUnique = '' and AnswerUnique = ''
If visibility is set to false,
Then sQuery = Update ScreenAnswers set Answer = 'Oracle' where PositionID =
'25' and QuestionUnique = '3' and AnswerUnique = '3'
How do I handle this?
Thanks,
Tom
them in my Sql Statement.
The problem is they are not there when set as "visible=false", but they are
if set to true.
For example:
I have:
*****************************************************************************************
<asp:BoundColumn DataField="Answer"
HeaderText="Answer"></asp:BoundColumn>
<asp:BoundColumn DataField="PositionID" visible="false"
HeaderText="PositionID"></asp:BoundColumn>
<asp:BoundColumn DataField="QuestionUnique"
visible="false" HeaderText="QuestionUnique"></asp:BoundColumn>
<asp:BoundColumn DataField="AnswerUnique" visible="false"
HeaderText="AnswerUnique"></asp:BoundColumn>
*******************************************************************************************
Where only "Answer" is visible - the others are key fields that I need for
my Sql and don't really want them displayed.
In my update routine:
******************************************************************************************
Sub DataUpdate(S as Object, E as DataGridCommandEventArgs)
Dim oGrid as DataGrid = CType(S, DataGrid)
oGrid.EditItemIndex=Cint(E.Item.ItemIndex)
dim pc as TextBox = e.item.Cells(1).controls(0)
dim quc as TextBox = e.Item.Cells(2).controls(0)
dim auc as TextBox = e.Item.Cells(3).controls(0)
dim txtAnswer as TextBox=E.Item.Cells(0).Controls(0)
Dim sQuery as String = "SELECT TOP 6
Answer,PositionID,QuestionUnique,AnswerUnique from ScreenAnswers where
PositionID = '" & pc.text & "' and QuestionUnique = '" & quc.text & "'"
******************************************************************************************
This works fine if "pc", "quc" and "auc" have visibility set to true.
Then sQuery = Update ScreenAnswers set Answer = 'Oracle' where PositionID
= '' and QuestionUnique = '' and AnswerUnique = ''
If visibility is set to false,
Then sQuery = Update ScreenAnswers set Answer = 'Oracle' where PositionID =
'25' and QuestionUnique = '3' and AnswerUnique = '3'
How do I handle this?
Thanks,
Tom