15,909,466 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Swayam231 (Top 81 by date)
Swayam231
2-Jun-13 12:20pm
View
+5!!!!
Swayam231
2-Jun-13 10:49am
View
windows application is ado.net i think... asp.net is web application!!
Swayam231
2-Jun-13 4:17am
View
well replace addwith to add and write this
("@us", sqldbtype.varchar).value= session["ss"].tostring
Let me know if it heps
Swayam231
1-Jun-13 14:44pm
View
don't write code in comments..
use improve question link and paste the code there.
Swayam231
1-Jun-13 13:44pm
View
Deleted
well u can't directly make asp.net to read string from image thats impossible!!! But say you have three captcha images u can store their values in string by writing:
string sdr= "2345";
and then validate that if textbox.text!= sdr.. show error.. for multiple captcha u can use the array concept
Swayam231
31-May-13 8:43am
View
well you can use a multiline textbox or use a label with width=100%!! Both can help
Swayam231
31-May-13 3:24am
View
i think this might help:
sql command cmd= new sql command("select * from login where rollid in(@a,@b,@c)",con)
now pass parameters for @a, @b, @c. lyk:
cmd.Parameters.Add("@a", SqlDbType.Int).Value = pid;
let me knw
Swayam231
31-May-13 3:08am
View
how are u providing values to @roleid?? code??
Swayam231
31-May-13 2:55am
View
okk. thanks
Swayam231
30-May-13 13:17pm
View
have u just thought or written some codes also..?? If yes then post it
Swayam231
30-May-13 10:30am
View
well if u elaborate a lil... about what you are doing maybe someone here will understand and help you!!
Swayam231
30-May-13 8:12am
View
and on bt4_click i am changing the values..
Swayam231
30-May-13 8:11am
View
Deleted
protected void Page_Load(object sender, EventArgs e)
{
string strConn = "Data Source=SWAYAM;Initial Catalog=Swayam;Integrated Security=SSPI; ";
SqlConnection con = new SqlConnection(strConn);
con.Open();
//panel1
string st = "select top 1 name,author,price from image4 order by Row_id desc";
SqlCommand cmd = new SqlCommand(st, con);
SqlDataReader sdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
string name = "";
string author = "";
string price = "";
if (sdr.Read())
{
name = sdr["name"].ToString();
author = sdr["author"].ToString();
price = sdr["price"].ToString();
}
sdr.Close();
con.Close();
//panel2
SqlConnection con2 = new SqlConnection(strConn);
con2.Open();
string st2="Select name, author, price from image4 where Row_id=(select max(Row_id)-1 from image4)";
SqlCommand cmd2 = new SqlCommand(st2, con2);
SqlDataReader sdr2 = cmd2.ExecuteReader(CommandBehavior.CloseConnection);
string name2="";
string author2="";
string price2="";
if (sdr2.Read())
{
name2 = sdr2["name"].ToString();
author2 = sdr2["author"].ToString();
price2 = sdr2["price"].ToString();
}
sdr2.Close();
con2.Close();
//panel3
SqlConnection con3 = new SqlConnection(strConn);
con3.Open();
string st3 = "Select name, author, price from image4 where Row_id=(select max(Row_id)-2 from image4)";
SqlCommand cmd3 = new SqlCommand(st3, con3);
SqlDataReader sdr3 = cmd3.ExecuteReader(CommandBehavior.CloseConnection);
string name3 = "";
string author3 = "";
string price3 = "";
if (sdr3.Read())
{
name3 = sdr3["name"].ToString();
author3 = sdr3["author"].ToString();
price3 = sdr3["price"].ToString();
}
sdr3.Close();
con3.Close();
Label1.Text = name;
Label2.Text = author;
Label3.Text = "Rs."+ price;
Label4.Text = name2;
Label5.Text = author2;
Label6.Text = "Rs."+ price2;
Label7.Text = name3;
Label8.Text = author3;
Label9.Text = "Rs."+ price3;
Image1.ImageUrl="~/Image handler.ashx?pid=0";
Image2.ImageUrl = "~/Image handler.ashx?pid=1";
Image3.ImageUrl = "~/Image handler.ashx?pid=2";
}
Swayam231
30-May-13 8:08am
View
no i haven't added isPostback condition
Swayam231
30-May-13 7:19am
View
here use this link it will help for ur view state
http://www.w3schools.com/aspnet/aspnet_viewstate.asp
Swayam231
30-May-13 7:10am
View
yes the images are being properly shown in the image control after i click on bt4.
Swayam231
30-May-13 7:09am
View
its already there on top
Swayam231
30-May-13 7:05am
View
have you tried any codes??? if yes then post it using the improve question link
Swayam231
30-May-13 7:01am
View
hey please provide the code that you have written and use the improve question link..
Swayam231
30-May-13 6:50am
View
well i agree with mahesh here.. Why passing to eventargs??? Use cookie, use session, use application, bt why event args????
Swayam231
30-May-13 6:47am
View
you are most welcome.. And you can accept the answer
Swayam231
30-May-13 6:46am
View
thanks buddy...
i feel that u edit that ms. to mr. !!!
I already did that check answer
And if u found that answer good accept it
Swayam231
30-May-13 6:45am
View
Deleted
thanks buddy...
i feel that u edit that ms. to mr. !!!
I already did that check answer
Swayam231
30-May-13 6:12am
View
or application state or cookies??
Swayam231
30-May-13 6:10am
View
u can use session??
Swayam231
30-May-13 5:43am
View
if there's any error let me know
Swayam231
29-May-13 15:00pm
View
yupp.. old url
Swayam231
29-May-13 14:56pm
View
i think the problem is with page_load??? i have written the imgeurl in page load so when a button is clicked its taking the values of url written in page load for the images?? ryt
Swayam231
29-May-13 14:52pm
View
i didn't get what you are saying abt other button
Swayam231
29-May-13 14:46pm
View
there is no problem in retrieving the images. it just works fine.. i want that the updated url and name must be stored in the session
Swayam231
29-May-13 14:42pm
View
it is just changing the images like this
image1.imageurl="handler.aspx?pid=4"
image2.imageurl="handler.aspx?pid=5"
image3.imageurl="handler.aspx?pid=6"
Swayam231
29-May-13 14:38pm
View
well the problem is that session is storing the url and the data of the first three images that are displayed but when the images are changed due to bt4_click the stored data of first three images is passed on. not of the new ones..
Swayam231
29-May-13 8:05am
View
Thanks Orcun Iyigun.. Works fine now!! :)
Swayam231
29-May-13 4:38am
View
sorry your code is not helping
Swayam231
29-May-13 4:33am
View
How do u call this thing in asp.net
Picturebox1.image???
i didn't find any . image criteria??
Swayam231
28-May-13 3:28am
View
the command text property on debugging shows
select top1 image1 from @tae;
i think @tae is not getting the value somehow
Swayam231
27-May-13 14:32pm
View
how to check which query is executed?
Swayam231
27-May-13 14:24pm
View
little more details please
Swayam231
27-May-13 14:22pm
View
must declare table variable @tae
Swayam231
27-May-13 14:21pm
View
here: SqlDataReader dr = cmd.ExecuteReader();
Swayam231
27-May-13 13:42pm
View
same buddy no change
Swayam231
27-May-13 12:04pm
View
Error msg:
must declare the table variable @tae
Swayam231
27-May-13 12:02pm
View
still not working
Swayam231
27-May-13 12:00pm
View
here: SqlDataReader dr = cmd.ExecuteReader();
Swayam231
27-May-13 8:43am
View
if thats the case what should i write here:
image1.imageurl="--------"; ?
Swayam231
27-May-13 8:26am
View
what is the datatype for table name?
Swayam231
27-May-13 8:24am
View
it is working fine problem was in '@tae'..
Swayam231
27-May-13 8:22am
View
and how to call it in the page??
Swayam231
27-May-13 8:21am
View
hey one more ques.. Can the same code be used for retrieving from different tables like
"Select top 1 image1 from @tablename";
do tell what to change in coding??
Swayam231
27-May-13 8:13am
View
thanks tadit!!!! It works fine now
even two of these '' can ruin a well coded project!!!! lol
Swayam231
27-May-13 8:10am
View
Do i have to change the calling part also:
image1.imageurl="~/imhandler.ashx?pid=Children Books"????
Swayam231
27-May-13 8:01am
View
No errors are thrown but the image is not shown in the page
Swayam231
27-May-13 7:53am
View
the image is not shown in the page.
Swayam231
27-May-13 4:50am
View
okk thanks for helping!
Swayam231
27-May-13 4:47am
View
thanks buddy!!!
Swayam231
27-May-13 4:40am
View
Here's my sample insert statement for inserting into single table:
SqlConnection cn = new SqlConnection();
cn.ConnectionString = //connection string
cn.Open();
string st="Insert into entrance books values("+textbox1.text+"","+textbox2.text+","+textbox3.text+","+textbox4.text+")";
sqlcommand cmd= new sqlcommand(st,cn);
cmd.executenonquey;
Swayam231
27-May-13 4:36am
View
i have thought about that but it will require separate insert statements for each selection!!
Swayam231
27-May-13 4:32am
View
Can you be little more detailed??
Swayam231
27-May-13 4:14am
View
my bad!!!!
Swayam231
25-May-13 6:25am
View
well max is applied only to int datatype... but using top 1* method will provide flexibility in choosing the column name!!!
Swayam231
25-May-13 4:29am
View
here's a gud example. Visit the link. If it works let me know:
http://www.codeproject.com/Articles/268123/Display-Store-and-Retrieve-Image-Data-from-Databas
Swayam231
25-May-13 4:24am
View
okk. are u using db to store the image or not??? U want to save image into the db and then retrieve it????
Swayam231
25-May-13 1:19am
View
well for displaying images in multiple pages you can use generic handler to control the images.. But please elaborate your question above~!
Swayam231
25-May-13 1:15am
View
what features???
Swayam231
24-May-13 3:09am
View
you were mentioning abt some function here... can u name the function please?
Swayam231
23-May-13 14:45pm
View
thanks tadit. Appreciate it!
Swayam231
23-May-13 14:43pm
View
it doesn't need to be registered in the web.config file.. just go to the solution explorer and add new item.. select generic handler and thats all.. I am using visual studio 2008.
Swayam231
23-May-13 14:40pm
View
<pre>
protected void Button1_Click(object sender, EventArgs e)
{
string strConn = "Data Source=SWAYAM;Initial Catalog=Swayam;Integrated Security=SSPI; ";
SqlConnection con = new SqlConnection(strConn);
con.Open();
string st = "select top 1 name,author,price,details from image3 order by Row_id desc";
SqlCommand cmd = new SqlCommand(st, con);
SqlDataReader sdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
string name = "";
string author = "";
string price = "";
string details = "";
if (sdr.Read())
{
name = sdr["name"].ToString();
author = sdr["author"].ToString();
price = sdr["price"].ToString();
details = sdr["details"].ToString();
}
Label1.Text = name;
Label2.Text = price;
Label3.Text = author;
Label4.Text = details;
}
}
</pre>
Here's wht is getting me my values from db
Swayam231
23-May-13 14:37pm
View
i am using handler because it manages image retrieval from db easily...
Swayam231
23-May-13 14:34pm
View
can u please give an example for that?? using the above data
Swayam231
23-May-13 14:31pm
View
okk but what to write in the page.aspx.cs to show this data in label???
Swayam231
23-May-13 14:20pm
View
Can u help me in this matter also??
http://www.codeproject.com/Questions/597325/canplusaplussoleplusgenericplushandlerplusbeplusus
Swayam231
23-May-13 14:19pm
View
so i have taken the data part to the other page and written it there. It works now!!
Swayam231
23-May-13 14:17pm
View
i do feel so.. thank you for ur time and opinion.
Swayam231
23-May-13 14:05pm
View
The last code is written in another page default.aspx having few imagecontrols and buttons.
Swayam231
23-May-13 13:44pm
View
i just want to make sure that the image and its details remains togethr.
Swayam231
23-May-13 13:43pm
View
because i am retrieving it alongside with a image together. haven't u gone through the sql query i have provided in the handler???
Swayam231
23-May-13 13:15pm
View
Those are codes written in two different pages buddy not in the same one...
One is generic handler.ashx and the other is default.aspx.. You just can't write lbl.text=name!!!
Swayam231
23-May-13 13:14pm
View
Deleted
Those are codes written in two different pages buddy not in the same one...
One is generic handler.ashx and the other is default.aspx.. You just can't write lbl.text=name!!!
Swayam231
23-May-13 5:32am
View
btn1_click()
{
Image1.ImageUrl = "imHandler.ashx?name="+Label1.Text+"?author="+Label2.Text+"?price="+Label3.Text+"";
}
I AM USING THE ABOVE CODES TO SHOW THE DATA IN LABELS BUT IT DOESN'T SEEM TO WORK.. pLEASE HELP..
Swayam231
23-May-13 5:12am
View
thank you very much.. but how to show the data in the page.. for image i have used
btn1_click(-------)
{
image1.imageurl="~/imghandler.ashx";
}
Show More