Click here to Skip to main content
15,920,801 members
Home / Discussions / C#
   

C#

 
QuestionCaching Pin
CrimeanTurtle20086-Jan-09 11:41
CrimeanTurtle20086-Jan-09 11:41 
AnswerRe: Caching Pin
Guffa6-Jan-09 11:57
Guffa6-Jan-09 11:57 
GeneralRe: Caching Pin
CrimeanTurtle20086-Jan-09 12:08
CrimeanTurtle20086-Jan-09 12:08 
GeneralRe: Caching Pin
Colin Angus Mackay6-Jan-09 12:32
Colin Angus Mackay6-Jan-09 12:32 
GeneralRe: Caching Pin
Guffa6-Jan-09 12:45
Guffa6-Jan-09 12:45 
GeneralRe: Caching Pin
CrimeanTurtle20086-Jan-09 12:55
CrimeanTurtle20086-Jan-09 12:55 
AnswerRe: Caching Pin
Jon Rista6-Jan-09 14:29
Jon Rista6-Jan-09 14:29 
GeneralRe: Caching Pin
moon_stick6-Jan-09 22:24
moon_stick6-Jan-09 22:24 
GeneralRe: Caching Pin
Jon Rista7-Jan-09 12:00
Jon Rista7-Jan-09 12:00 
QuestionWhen to declare windows service application settings Pin
KaptinKrunch6-Jan-09 10:27
KaptinKrunch6-Jan-09 10:27 
AnswerRe: When to declare windows service application settings Pin
Not Active6-Jan-09 10:45
mentorNot Active6-Jan-09 10:45 
AnswerRe: When to declare windows service application settings Pin
Sunny Ahuwanya6-Jan-09 10:46
Sunny Ahuwanya6-Jan-09 10:46 
Questionwhat's wrong, Object reference not set to an instance of an object. Pin
suni_dotnet6-Jan-09 9:47
suni_dotnet6-Jan-09 9:47 
AnswerRe: what's wrong, Object reference not set to an instance of an object. Pin
Jon Rista6-Jan-09 10:00
Jon Rista6-Jan-09 10:00 
GeneralRe: what's wrong, Object reference not set to an instance of an object. Pin
suni_dotnet6-Jan-09 10:17
suni_dotnet6-Jan-09 10:17 
GeneralRe: what's wrong, Object reference not set to an instance of an object. Pin
Jon Rista6-Jan-09 14:34
Jon Rista6-Jan-09 14:34 
AnswerRe: what's wrong, Object reference not set to an instance of an object. Pin
Pete O'Hanlon6-Jan-09 10:15
mvePete O'Hanlon6-Jan-09 10:15 
GeneralRe: what's wrong, Object reference not set to an instance of an object. Pin
suni_dotnet6-Jan-09 10:22
suni_dotnet6-Jan-09 10:22 
AnswerRe: what's wrong, Object reference not set to an instance of an object. Pin
Rutvik Dave6-Jan-09 11:17
professionalRutvik Dave6-Jan-09 11:17 
First of all try to explain what you want to do with the code.

if you want to store the value (which is added directly in the gridview) in the database,

then try to use GridView2.Rows[e.RowIndex].Cell[3].Text for all the cells, becuase it can be possible that no rows selected at that time.

also assign the Values of the gridview to some variable and the check wether the value is null or not.

i.e.

string FilledDate = GridView2.Rows[e.RowIndex].Cell[3].Text;
if (FilledDate != null)
    cmd.Parameters.AddWithValue("@filleddate", FilledDate);
else
    cmd.Parameters.AddWithValue("@filleddate", ""); // or give appropriate error messege instead of inserting blank values.


-----------------------

or you can use directly

e.NewValues[3] Instead of GridView2.SelectedRow.Cells[3].Text
in your original code.

e.NewValue will give you all the new updated values.
e.OldValue will give you all the old existing values.

do this for all the fields.

and one more thing give GridView2 some appropriate Name, instead of using auto generated name.
AnswerRe: what's wrong, Object reference not set to an instance of an object. Pin
Wendelius6-Jan-09 11:18
mentorWendelius6-Jan-09 11:18 
QuestionHOW CAN MADE MESSENGER IN C#.NET?HOW CAN MADE STUDENT FORM IN C#.NET? Pin
mohammedali20066-Jan-09 9:25
mohammedali20066-Jan-09 9:25 
AnswerRe: HOW CAN MADE MESSENGER IN C#.NET?HOW CAN MADE STUDENT FORM IN C#.NET? Pin
EliottA6-Jan-09 9:28
EliottA6-Jan-09 9:28 
GeneralRe: HOW CAN MADE MESSENGER IN C#.NET?HOW CAN MADE STUDENT FORM IN C#.NET? Pin
Dave Kreskowiak6-Jan-09 9:54
mveDave Kreskowiak6-Jan-09 9:54 
GeneralRe: HOW CAN MADE MESSENGER IN C#.NET?HOW CAN MADE STUDENT FORM IN C#.NET? Pin
EliottA6-Jan-09 9:56
EliottA6-Jan-09 9:56 
GeneralRe: HOW CAN MADE MESSENGER IN C#.NET?HOW CAN MADE STUDENT FORM IN C#.NET? Pin
Dave Kreskowiak6-Jan-09 10:43
mveDave Kreskowiak6-Jan-09 10:43 

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.