Datagridview help

lsdev

Well-known member
Joined
Jan 20, 2008
Messages
61
Programming Experience
1-3
Right basically I have a data grid at the moment with the following details:

CustomerID,InterviewDate,comments

This is fine, but I would also like the user to be about to see the customer's firstname and surname in the grid, which is currently stored in another table. Is there a way of getting these details into the gridview?

I need not be able to edit these additional details just to be able to see/display them. I have tried creating a view but feel this is probably the wrong way of tackling this issue due to the addition updating overhead that comes with using views. Any help will be great
 
Create a View for sure.. but you will manually have to edit the UPDATE/INSERT/DELETE statements to just use the one main table that is to remain editable

Oh, and if it doesnt already, then set the columns of the first and last name to read only..
 
Create a View for sure.. but you will manually have to edit the UPDATE/INSERT/DELETE statements to just use the one main table that is to remain editable

Oh, and if it doesnt already, then set the columns of the first and last name to read only..

That is exaclty what I have done, the issue I have is that the:
InterviewDate, comments

columns allow nulls so how do I do it so that it allows for this.

Thanks for your swift reply
 
Well basically I have a for loop that iterates over the datagrid and does an update on each row passing the row details for interview date and comment for the customerID for that row, but if there is no data in these columns (int & comment) I receive an error. I can only assume this is because there is no data, hence is there a way of replacing the details passed from the columns with "Null" to the update command?

I am not at my PC so unfortunatly can not give an example of my code. But I am basically looping through each row in the datagridview and updating it.... Is there a better way of implementing this? As I would like to be able to delete aswell
 

Latest posts

Back
Top