Click here to Skip to main content
16,004,927 members
Home / Discussions / C#
   

C#

 
AnswerRe: call form problem? Pin
carlecomm13-Jan-10 19:24
carlecomm13-Jan-10 19:24 
QuestionWhat is the connection string for connecting your C# to a remote server ? Pin
jedongkendrick12-Jan-10 15:07
jedongkendrick12-Jan-10 15:07 
AnswerRe: What is the connection string for connecting your C# to a remote server ? Pin
Not Active12-Jan-10 15:43
mentorNot Active12-Jan-10 15:43 
AnswerRe: What is the connection string for connecting your C# to a remote server ? Pin
Abhinav S12-Jan-10 16:13
Abhinav S12-Jan-10 16:13 
AnswerRe: What is the connection string for connecting your C# to a remote server ? Pin
Dave Kreskowiak12-Jan-10 18:31
mveDave Kreskowiak12-Jan-10 18:31 
QuestionHow to use values from the datagrid to add values to a database Pin
jedongkendrick12-Jan-10 15:05
jedongkendrick12-Jan-10 15:05 
AnswerRe: How to use values from the datagrid to add values to a database Pin
Not Active12-Jan-10 15:46
mentorNot Active12-Jan-10 15:46 
AnswerRe: How to use values from the datagrid to add values to a database Pin
loyal ginger13-Jan-10 6:11
loyal ginger13-Jan-10 6:11 
In your case if you set the data source of the datagrid to be a select query with the 4 fields needed by the datagrid selected, you will have to do some work to make it write back to the database table with the modified values together with the values from the two labels to all 6 fields. The "lazy" binding will not work automatically for you.

There are easy solutions to this problem, though. The binding of datagrid to a table (so that you can update the table) works well if you have all the fields needed for the table to be updated selected in the datagrid. You always have the freedom to use in-memory table to achieve this. Create a DataTable with the four fields that are needed for the datagrid and bind it to the datagrid. (If you need to modify existing records you need to populate this DataTable first.) In the "Save" button handler, use code to update the real table by the data in the DataTable AND the values in the two labels.

I am sorry I can't offer you a code sample for this but I assure you this works. I have done this in my projects, and it is not that complicated.

Good luck and happy programming!
QuestionScreen On/Off Pin
usstang12-Jan-10 11:34
usstang12-Jan-10 11:34 
AnswerRe: Screen On/Off Pin
Abhinav S12-Jan-10 15:48
Abhinav S12-Jan-10 15:48 
AnswerRe: Screen On/Off Pin
Not Active12-Jan-10 15:48
mentorNot Active12-Jan-10 15:48 
QuestionConsole Applications Pin
Darrall12-Jan-10 8:41
Darrall12-Jan-10 8:41 
AnswerRe: Console Applications Pin
CoderGirl4212-Jan-10 12:46
CoderGirl4212-Jan-10 12:46 
GeneralRe: Console Applications Pin
Darrall12-Jan-10 13:33
Darrall12-Jan-10 13:33 
GeneralRe: Console Applications Pin
CTF6612-Jan-10 14:19
CTF6612-Jan-10 14:19 
GeneralRe: Console Applications Pin
Not Active12-Jan-10 15:42
mentorNot Active12-Jan-10 15:42 
QuestionClose when made inactive Pin
will kirkby12-Jan-10 8:29
will kirkby12-Jan-10 8:29 
AnswerRe: Close when made inactive Pin
DaveyM6912-Jan-10 8:38
professionalDaveyM6912-Jan-10 8:38 
AnswerRe: Close when made inactive Pin
Rick Shaub12-Jan-10 8:38
Rick Shaub12-Jan-10 8:38 
GeneralRe: Close when made inactive Pin
will kirkby12-Jan-10 8:44
will kirkby12-Jan-10 8:44 
AnswerRe: Close when made inactive Pin
#realJSOP13-Jan-10 0:26
professional#realJSOP13-Jan-10 0:26 
QuestionCreate mail acount in exchange server Pin
zeeShan anSari12-Jan-10 4:53
zeeShan anSari12-Jan-10 4:53 
QuestionBring Custom Control Ahead of form Pin
amitsol12-Jan-10 3:34
amitsol12-Jan-10 3:34 
AnswerRe: Bring Custom Control Ahead of form Pin
Saksida Bojan12-Jan-10 6:32
Saksida Bojan12-Jan-10 6:32 
AnswerRe: Bring Custom Control Ahead of form Pin
Eddy Vluggen12-Jan-10 8:16
professionalEddy Vluggen12-Jan-10 8:16 

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.