How to display value from SQL server to Message Box

Posted by Yogi1990 under Sql Server on 7/5/2011 | Points: 10 | Views : 5940 | Status : [Member] | Replies : 12
I am using sqlDataReader
its reading perfectally
but the problem how to dispaly the field values
........this is my output in sql server
Roll_no
1
2
3
4
I want to dispaly these field values by using message box
How can I do this please help me out.

Yogi


Responses

Posted by: Lakn2 on: 7/5/2011 [Member] Starter | Points: 25

Up
0
Down
if you want to show in asp.net use
sqlcommand cmd=new sqlcommand("select Roll_no fron tablename",cn);

sqldatareader dr;
dr=cmd.Executereader();
if(dr.read())
{

page.registerstartupscript("<script>","<script>alert(' "+ dr[0].tostring()+" ')</script");
}


Thanks&Regards
LakshmiNarayana Nalluri.

Yogi1990, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yogi1990 on: 7/5/2011 [Member] Starter | Points: 25

Up
0
Down
Thanks!!!

Yogi

Yogi1990, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakn2 on: 7/5/2011 [Member] Starter | Points: 25

Up
0
Down
if you get answer mark as answer then no one give answer.

Thanks&Regards
LakshmiNarayana Nalluri.

Yogi1990, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yogi1990 on: 7/5/2011 [Member] Starter | Points: 25

Up
0
Down
Sure but if any other guy want to give their answer they can post.

Thanks for your responce!!!

Yogi

Yogi1990, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakn2 on: 7/5/2011 [Member] Starter | Points: 25

Up
0
Down
no no what i am saying is if you get what you want no need to see another anser so it is better to mark as asnwer

Thanks&Regards
LakshmiNarayana Nalluri.

Yogi1990, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yogi1990 on: 7/5/2011 [Member] Starter | Points: 25

Up
0
Down
Ok !!!Finish this discussion here only...
Please!!!



Thanks!!!

Yogi

Yogi1990, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CS1401 on: 7/6/2011 [Member] Starter | Points: 25

Up
0
Down
Response.Write("<script>alert(' "+ dr[0].tostring()+" ')</script>");

before that you must know the steps hope;)

...

Yogi1990, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yogi1990 on: 7/6/2011 [Member] Starter | Points: 25

Up
0
Down
Hi CS1401
Please ellobrate more on this?

Thanks!!!

Yogi

Yogi1990, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CS1401 on: 7/6/2011 [Member] Starter | Points: 25

Up
0
Down
Response.Write("<script>alert(' " + dr[0].tostring() + " ')</script>");

Pls tell first this code working fine or not?


...

Yogi1990, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 7/6/2011 [Member] Starter | Points: 25

Up
0
Down
Dear All,

Why everybody is going to show the data using alert?
First of all in some scenario more than one data need to be displayed in a proper format, it won't work effectively.
I would rather insist to use a modalpopup extender control, to display a panel and inside that you can add any asp.net server control.

Then show this modalpopup control where ever you want.

Thanks,
Debata



Yogi1990, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yogi1990 on: 7/6/2011 [Member] Starter | Points: 25

Up
0
Down
Hi CS1401,
I didn't try it but ,I want some more points in this.
If u can Please give...........

Yogi

Yogi1990, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CS1401 on: 7/6/2011 [Member] Starter | Points: 25

Up
0
Down
System.Data.OleDb.OleDbDataAdapter dr = new System.Data.OleDb.OleDbDataAdapter("select * from mans1", conn);
DataSet s = new DataSet();
dr.Fill(s);
DataRow dro=new DataRow;
dro=s.Tables[0].Rows;
if(dr.read())

{
Response.Write("<script>alert(' " + dro[0].Tostring() + " ')</script>");
}

write this code in button click event.
I didnt try to compile. Pls check. Do u need anyother help..

Note:
You can use javascript window.open() to show modal popup dialog box also. Pls googling..

...

Yogi1990, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response