Click here to Skip to main content
15,888,461 members
Home / Discussions / Database
   

Database

 
GeneralRe: update Query with Order by Clause- SQL Server2008 Pin
i.j.russell12-Jan-10 3:54
i.j.russell12-Jan-10 3:54 
AnswerRe: update Query with Order by Clause- SQL Server2008 Pin
i.j.russell12-Jan-10 3:57
i.j.russell12-Jan-10 3:57 
AnswerRe: update Query with Order by Clause- SQL Server2008 [modified] Pin
loyal ginger12-Jan-10 4:06
loyal ginger12-Jan-10 4:06 
AnswerRe: update Query with Order by Clause- SQL Server2008 Pin
Corporal Agarn12-Jan-10 5:10
professionalCorporal Agarn12-Jan-10 5:10 
GeneralRe: update Query with Order by Clause- SQL Server2008 Pin
i.j.russell12-Jan-10 5:15
i.j.russell12-Jan-10 5:15 
QuestionGetting underlying table-column value from a selected DataGridRow [Solved] Pin
AussieLew11-Jan-10 18:07
AussieLew11-Jan-10 18:07 
AnswerRe: Getting underlying table-column value from a selected DataGridRow Pin
Mycroft Holmes11-Jan-10 18:40
professionalMycroft Holmes11-Jan-10 18:40 
GeneralRe: Getting underlying table-column value from a selected DataGridRow Pin
AussieLew11-Jan-10 21:27
AussieLew11-Jan-10 21:27 
Thanks for your reply!

To expand a bit further...
I have set up the DGV so that no edits , updates etc can be done in the DGV.
So the whole DGV is ReadOnly.

I am providing the edit/add fields ( as databound textboxes etc )separately elsewhere on the form.
These normally display a bit more info than the DGV itself, and are all ReadOnly unless an Edit button (or row double click - yet to be done) is clicked.

If the Boolean flag (as you said,in a hidden column) allows edits, I change all the appropriate TextBox.ReadOnly values to allow changes there.
(There are some rows that I don't want the user ever to edit or delete)

(1)So, if it is considered to be best practice to get the column value from the table itself rather than the DGV , I need to get the row index of the table that matches the current row in the DGV.
(2) Also being able to use MyDataSet.MyTable1[pos].HTReadOnly ) syntax allow for error checking in the IDE in case of wrong column name or wrong type etc

Otherwise I can get the DGV row/column value from ( off the top of my head) with
DataGridViewRow dgvr = table1DataGridView.CurrentRow;
DataRowView drv = (DataRowView )dgvr.DataBoundItem;
bool isReadOnly = drv.Row["htreadonly"];


By using drv.Row["htreadonly"]; am I in fact looking directly at the data?
If so it leaves only point (2) which I think is significant instead of coding (as at present) to catch runtime errors.


Hope this serves to clarify, not confuse....

LJL
GeneralRe: Getting underlying table-column value from a selected DataGridRow Pin
Mycroft Holmes11-Jan-10 22:12
professionalMycroft Holmes11-Jan-10 22:12 
GeneralRe: Getting underlying table-column value from a selected DataGridRow Pin
AussieLew12-Jan-10 0:46
AussieLew12-Jan-10 0:46 
GeneralRe: Getting underlying table-column value from a selected DataGridRow Pin
Mycroft Holmes12-Jan-10 14:00
professionalMycroft Holmes12-Jan-10 14:00 
QuestionSelecting Rows Pin
sriharsha_1210-Jan-10 19:32
sriharsha_1210-Jan-10 19:32 
AnswerRe: Selecting Rows PinPopular
Mycroft Holmes10-Jan-10 20:59
professionalMycroft Holmes10-Jan-10 20:59 
GeneralRe: Selecting Rows Pin
sriharsha_1210-Jan-10 23:08
sriharsha_1210-Jan-10 23:08 
QuestionOracle Pin
MsmVc10-Jan-10 17:14
MsmVc10-Jan-10 17:14 
AnswerRe: Oracle Pin
Mycroft Holmes10-Jan-10 18:15
professionalMycroft Holmes10-Jan-10 18:15 
AnswerRe: Oracle Pin
Jörgen Andersson10-Jan-10 21:56
professionalJörgen Andersson10-Jan-10 21:56 
Questionget list of weeks with week number Pin
Maddie from Dartford10-Jan-10 5:08
Maddie from Dartford10-Jan-10 5:08 
AnswerRe: get list of weeks with week number Pin
Herman<T>.Instance13-Jan-10 3:53
Herman<T>.Instance13-Jan-10 3:53 
QuestionProblem with subquery returning more than 1 value [Solved] Pin
James Shao10-Jan-10 4:34
James Shao10-Jan-10 4:34 
AnswerRe: Problem with subquery returning more than 1 value Pin
dan!sh 10-Jan-10 4:50
professional dan!sh 10-Jan-10 4:50 
GeneralRe: Problem with subquery returning more than 1 value Pin
James Shao10-Jan-10 15:05
James Shao10-Jan-10 15:05 
AnswerRe: Problem with subquery returning more than 1 value Pin
Ashfield10-Jan-10 5:37
Ashfield10-Jan-10 5:37 
GeneralRe: Problem with subquery returning more than 1 value Pin
James Shao10-Jan-10 12:21
James Shao10-Jan-10 12:21 
GeneralRe: Problem with subquery returning more than 1 value Pin
dxlee10-Jan-10 15:34
dxlee10-Jan-10 15:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.