Click here to Skip to main content
16,011,757 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: How to create a chatroom application Pin
Philip Patrick7-Feb-03 21:47
professionalPhilip Patrick7-Feb-03 21:47 
Questionhow can you dynamically add hidden form element in ASP.NET Pin
devvvy7-Feb-03 16:55
devvvy7-Feb-03 16:55 
Generalmouseover color for DataGrid. Pin
devvvy7-Feb-03 16:25
devvvy7-Feb-03 16:25 
GeneralRe: mouseover color for DataGrid. Pin
Steve McLenithan7-Feb-03 18:11
Steve McLenithan7-Feb-03 18:11 
QuestionCan I hide <option> elements? Pin
jerry0davis7-Feb-03 4:01
jerry0davis7-Feb-03 4:01 
AnswerRe: Can I hide <option> elements? Pin
Paul Riley7-Feb-03 4:28
Paul Riley7-Feb-03 4:28 
GeneralRe: Can I hide <option> elements? Pin
jerry0davis7-Feb-03 4:31
jerry0davis7-Feb-03 4:31 
Generaluniqueidentifier, adoguid, DataGrid Pin
devvvy6-Feb-03 22:03
devvvy6-Feb-03 22:03 
uniqueidentifier, adoguid, DataGrid

1. MY TABLE SCHEMA:
I have this table with the following schema:

column SQL server data type ado data type
MsgID uniqueidentifier adoguid
MsgTitle char(250) adchar
MsgBody char(5000) adchar

2. WHAT I DID:
I load the data into a DataSet, then load the DataSet into a DataView (i need it for RowFilter), then bind the DataView to DataGrid. Code snippet as follows:

oConn = new SqlConnection(sConnect);

daForum = new SqlDataAdapter(sCommand, oConn);
daForum.Fill(this.dsForum, "Forum"); //dsForum is the DataSet

this.dvForum.Table = this.dsForum.Tables["Forum"];

//DataView: Apply row filter - we want to display root message only: ie. ParentMsgID='Null'
dvForum.RowFilter="IsNull(ParentMsgID,'Null')='Null'";

//DataGrid:
this.dgForum.DataSource = dvForum;
this.dgForum.DataBind();

oConn.Close();

3. THE PROBLEM:
3a. MsgID column disappeared? Where did this happen? When I load it to DataView? Or when DataGrid binds to DataView?
3b. The intention is, when user click a row on the datagrid, I would retrieve MsgID with "ItemCommand" event handling mechanism:

protected void Command(Object Sender, DataGridCommandEventArgs e)
{
....
//Reference (data type): http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=454
Guid gdMsgID;
gdMsgID = e.Item.Cell[0].Text; //I wish to retrieve MsgID as follows.
}

code snippet will be very helpful... thanks!uniqueidentifier, adoguid, DataGrid

1. MY TABLE SCHEMA:
I have this table with the following schema:

column SQL server data type ado data type
MsgID uniqueidentifier adoguid
MsgTitle char(250) adchar
MsgBody char(5000) adchar

2. WHAT I DID:
I load the data into a DataSet, then load the DataSet into a DataView (i need it for RowFilter), then bind the DataView to DataGrid. Code snippet as follows:

oConn = new SqlConnection(sConnect);

daForum = new SqlDataAdapter(sCommand, oConn);
daForum.Fill(this.dsForum, "Forum"); //dsForum is the DataSet

this.dvForum.Table = this.dsForum.Tables["Forum"];

//DataView: Apply row filter - we want to display root message only: ie. ParentMsgID='Null'
dvForum.RowFilter="IsNull(ParentMsgID,'Null')='Null'";

//DataGrid:
this.dgForum.DataSource = dvForum;
this.dgForum.DataBind();

oConn.Close();

3. THE PROBLEM:
3a. MsgID column disappeared? Where did this happen? When I load it to DataView? Or when DataGrid binds to DataView?
3b. The intention is, when user click a row on the datagrid, I would retrieve MsgID with "ItemCommand" event handling mechanism:

protected void Command(Object Sender, DataGridCommandEventArgs e)
{
....
//Reference (data type): http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=454
Guid gdMsgID;
gdMsgID = e.Item.Cell[0].Text; //I wish to retrieve MsgID as follows.
}

code snippet will be very helpful... thanks!

norm
GeneralRe: uniqueidentifier, adoguid, DataGrid Pin
devvvy6-Feb-03 22:50
devvvy6-Feb-03 22:50 
GeneralI've got the Guid displayed on DataGrid, but still need to retrieve it and call stored procedure. Pin
devvvy7-Feb-03 9:32
devvvy7-Feb-03 9:32 
GeneralFound a way to get around this. Pin
devvvy7-Feb-03 16:31
devvvy7-Feb-03 16:31 
QuestionAny body helps ? Pin
Jackal Jiang6-Feb-03 20:25
Jackal Jiang6-Feb-03 20:25 
AnswerRe: Any body helps ? Pin
Steve McLenithan7-Feb-03 18:21
Steve McLenithan7-Feb-03 18:21 
AnswerRe: Any body helps ? Pin
devvvy7-Feb-03 18:24
devvvy7-Feb-03 18:24 
AnswerRe: Any body helps ? Pin
Philip Patrick7-Feb-03 21:48
professionalPhilip Patrick7-Feb-03 21:48 
AnswerThank you all Pin
Jackal Jiang9-Feb-03 18:54
Jackal Jiang9-Feb-03 18:54 
GeneralWeb development Pin
Member 36856806-Feb-03 19:50
Member 36856806-Feb-03 19:50 
GeneralRe: Web development Pin
Roger Wright6-Feb-03 20:05
professionalRoger Wright6-Feb-03 20:05 
Generalpath, <EMBED> and Server.Transfer Pin
devvvy6-Feb-03 18:51
devvvy6-Feb-03 18:51 
GeneralRe: path, <embed> and Server.Transfer Pin
Philip Patrick7-Feb-03 21:51
professionalPhilip Patrick7-Feb-03 21:51 
GeneralRe: path, <embed> and Server.Transfer Pin
devvvy7-Feb-03 22:24
devvvy7-Feb-03 22:24 
QuestionHow can CGI be so difficult? Pin
georgiek506-Feb-03 14:17
georgiek506-Feb-03 14:17 
AnswerRe: How can CGI be so difficult? Pin
benjymous7-Feb-03 4:57
benjymous7-Feb-03 4:57 
GeneralRe: How can CGI be so difficult? Pin
georgiek507-Feb-03 7:21
georgiek507-Feb-03 7:21 
GeneralIcon address toolbar Pin
marnicola6-Feb-03 9:53
marnicola6-Feb-03 9:53 

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.