Click here to Skip to main content
15,916,941 members
Home / Discussions / C#
   

C#

 
GeneralRe: Stupid (IMHO) Visual Studio Issue Pin
Amar Chaudhary28-Nov-06 13:23
Amar Chaudhary28-Nov-06 13:23 
Questionconnecting to oracle 10g Pin
hadad28-Nov-06 10:41
hadad28-Nov-06 10:41 
AnswerRe: connecting to oracle 10g Pin
Paul Conrad28-Nov-06 13:28
professionalPaul Conrad28-Nov-06 13:28 
AnswerRe: connecting to oracle 10g Pin
User 58385228-Nov-06 13:57
User 58385228-Nov-06 13:57 
QuestionHow do you customize your applications for clients? Pin
snorkie28-Nov-06 10:34
professionalsnorkie28-Nov-06 10:34 
AnswerRe: How do you customize your applications for clients? Pin
Eduard Keilholz28-Nov-06 20:27
Eduard Keilholz28-Nov-06 20:27 
GeneralRe: How do you customize your applications for clients? Pin
snorkie29-Nov-06 5:34
professionalsnorkie29-Nov-06 5:34 
QuestionGridView losing its dataset Pin
Abbas8228-Nov-06 8:00
Abbas8228-Nov-06 8:00 
Hi,

I am working on a GridView control to play a game. I am trying to make the cells editable; however, when I click on edit I lost my data or I get an error:

Object reference not set to an instance of an object

Here is a code sample (excuse the messiness, I am still debugging things and I like to clean-up at the end)


protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!IsPostBack)<br />
{<br />
NewGame(0); <br />
}<br />
else<br />
{<br />
lblStatus.Text = lblStatus.Text + "postback!";<br />
//DataRow[] currentRows = mySet.Tables["numberset"].Select(null, null, DataViewRowState.CurrentRows);<br />
mySet = _newGame.GameSet;<br />
DataRow[] currentRows = mySet.Tables["problemcopyset"].Select(null, null, DataViewRowState.CurrentRows);<br />
foreach (DataRow row in currentRows)<br />
{<br />
foreach (DataColumn column in mySet.Tables["problemcopyset"].Columns)<br />
{<br />
lblStatus.Text = lblStatus.Text + row[column] ; //+ "(" + ;<br />
}<br />
////lblStatus.Text = lblStatus.Text + row.RowState;<br />
}<br />
lblStatus.Text = lblStatus.Text + "<br />
";<br />
}<br />
}<br />
<br />
private void NewGame(int index)<br />
{<br />
GameLevel[] levels = { GameLevel.SIMPLE, GameLevel.MEDIUM, GameLevel.COMPLEX };<br />
<br />
<br />
if (index > -1)<br />
{<br />
_newGame.GenerateGame(levels[index]);<br />
gameGrid.Visible = false;<br />
_currentSet = _newGame.GameSet;<br />
mySet = _currentSet;<br />
_currentSet.Tables["numberset"].DefaultView.AllowNew = false;<br />
//_currentSet.Tables["numberset"].Columns["numbersets_Id"].ReadOnly = true;<br />
<br />
<br />
if (_currentSet != null)<br />
{<br />
_currentSet.Tables["answerset"].ColumnChanging += new DataColumnChangeEventHandler(this.CurrentSet_ColumnChanging);<br />
//DataRow[] currentRows = _currentSet.Tables["numberset"].Select(null, null, DataViewRowState.CurrentRows);<br />
}<br />
gameGrid.Visible = true;<br />
gameGrid.DataSource = _currentSet.Tables["numberset"];<br />
gameGrid.DataBind();<br />
<br />
}<br />
<br />
<br />
}<br />
protected void gameGrid_RowEditing(object sender, GridViewEditEventArgs e)<br />
{<br />
lblStatus.Text = lblStatus.Text + "<br />
editing!<br />
";<br />
gameGrid.EditIndex = e.NewEditIndex;<br />
gameGrid.DataSource = mySet.Tables["numberset"];<br />
gameGrid.DataBind();<br />
}

Any help would be greatly appreciated.

Thanks!
AnswerRe: GridView losing its dataset Pin
ednrgc28-Nov-06 8:46
ednrgc28-Nov-06 8:46 
GeneralRe: GridView losing its dataset Pin
Abbas8228-Nov-06 9:59
Abbas8228-Nov-06 9:59 
QuestionJNI.NET.Bridge [modified] Pin
GoLuM_3028-Nov-06 7:54
GoLuM_3028-Nov-06 7:54 
QuestionNeed free Task Pane Component. Pin
hdv21228-Nov-06 7:21
hdv21228-Nov-06 7:21 
AnswerRe: Need free Task Pane Component. Pin
Judah Gabriel Himango28-Nov-06 7:27
sponsorJudah Gabriel Himango28-Nov-06 7:27 
QuestionTabbed windows like Visual studio 2005 Pin
Nitin198128-Nov-06 6:42
Nitin198128-Nov-06 6:42 
AnswerRe: Tabbed windows like Visual studio 2005 Pin
Judah Gabriel Himango28-Nov-06 7:26
sponsorJudah Gabriel Himango28-Nov-06 7:26 
GeneralRe: Tabbed windows like Visual studio 2005 Pin
Scott Dorman28-Nov-06 11:30
professionalScott Dorman28-Nov-06 11:30 
GeneralRe: Tabbed windows like Visual studio 2005 Pin
Nitin198128-Nov-06 17:56
Nitin198128-Nov-06 17:56 
AnswerRe: Tabbed windows like Visual studio 2005 Pin
bankai12328-Nov-06 21:02
bankai12328-Nov-06 21:02 
QuestionC# Excel SQL Query Question Pin
808 State28-Nov-06 6:25
808 State28-Nov-06 6:25 
AnswerRe: C# Excel SQL Query Question Pin
ednrgc28-Nov-06 6:37
ednrgc28-Nov-06 6:37 
GeneralRe: C# Excel SQL Query Question Pin
808 State28-Nov-06 7:28
808 State28-Nov-06 7:28 
GeneralRe: C# Excel SQL Query Question Pin
808 State28-Nov-06 8:06
808 State28-Nov-06 8:06 
QuestionProblem in Resize Image of PictureBox Pin
hdv21228-Nov-06 6:17
hdv21228-Nov-06 6:17 
AnswerRe: Problem in Resize Image of PictureBox Pin
ednrgc28-Nov-06 6:28
ednrgc28-Nov-06 6:28 
GeneralRe: Problem in Resize Image of PictureBox Pin
hdv21228-Nov-06 7:15
hdv21228-Nov-06 7:15 

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.