|
This is happening because the text what you have stored in string ID is the same what you are getting. What you need to do is to store the data (what sqlquery is returning) in dataset and then use dataset to display the data.
Apurva Kaushal
|
|
|
|
|
This is the code i wrote in which i used the dataset but how to assign the value of dataset into the ID variabe iam not geeting, If possible pl modify the code and send me its having error and I am not getting what to do Pl help me Apurva
Dim con3 As New SqlConnection
Dim cmd3 As New SqlCommand
con3.ConnectionString = "workstation id=R21;packet size=4096;integrated security=SSPI;data source=R21;persist security info=False;initial catalog=Test"
con3.Open()
Dim ds3 As New DataSet
Dim queryString3 As String = "select Cand_Id from Feedback where Cand_Id in(select Max(Cand_Id) from Feedback )"
cmd3.CommandText = queryString
cmd3.Connection = con
Dim sqlda As New SqlDataAdapter(queryString3, con3)
sqlda.Fill(ds3)
ID = ds3
Response.Write("alert('" + ID.ToString() + "')")
con3.Close()
Regards
Prakash Mishra(Banglore,India)
|
|
|
|
|
Prakash_Mishra wrote: ID = ds3
Inspite of that take it as this:
ID = ds3.Tables[0].Rows[0]["Cand_Id"].ToString();
Apurva Kaushal
|
|
|
|
|
If i am writing that line i am getting the following error
value of type 'SystemData.DataTableCollection' can not be converted to string
Prakash Mishra(Banglore,India)
|
|
|
|
|
What exactly is the line which you have used?
Apurva Kaushal
|
|
|
|
|
ID = ds3.Tables[0].Rows[0]["Cand_Id"].ToString()
Prakash Mishra(Banglore,India)
|
|
|
|
|
Is ID is of string type?
put like this:
string ID = ds3.Tables[0].Rows[0]["Cand_Id"].ToString()
Apurva Kaushal
|
|
|
|
|
Thanks Apurva for being so patient. Yes its of type string
In the statement ds3.Tables[0].Rows[0]["Cand_Id"].ToString(). Its asking for identifier expected in statement
ds3.Tables[0]
below[0]. Is is a synatx prob i am using VB
Prakash Mishra(Banglore,India)
|
|
|
|
|
In vb.net it will be like this:
ID = ds.Tables(0).Rows(0)("ID").ToString()
Apurva Kaushal
|
|
|
|
|
THANKS APURVA
I TRIED WITH ROUND BRACKET AND IT WORKED. THANKS FOR BEING SO NICE TO ME. THANKS A LOT.
REGARDS
Prakash Mishra(Banglore,India)
|
|
|
|
|
Always welcome..
Apurva Kaushal
|
|
|
|
|
Hai friends..
I am new to asp.net.I would like to know how to Redirect from one URL to another URL.My problem is that i upload my project in server.suppose, www.firstproject.com is the website name ,in that project there is link to go to www.secondproject.com.....(these two works are uploaded in 2 different server).But it is not working with my code....How to do that????any idea please help me....am using .NET 1.1 version and c# coding......
Thanks in advance
|
|
|
|
|
Response.Redirect() will serve the purpose for you.
Apurva Kaushal
|
|
|
|
|
Thanks for your reply.
But Actually my problem is different ,i dont want to redirect from one page to another page in the same project.Instead of that ,i want to redirect from one website to another site...for example www.yahoo.com to www.rediffmail.com
|
|
|
|
|
That will work fine with that also. You can redirect to another site also.
Apurva Kaushal
|
|
|
|
|
Thanku very much for your confident reply
I try Response.redirect withot using http in first time
But after your reply i try with http (ie,Response.redirect("http://www.xyz.com");
now my case is working fine.
Thanks once again
|
|
|
|
|
Always welcome..
Apurva Kaushal
|
|
|
|
|
Use, Response.Redirect("testpage.aspx");
will help you.
where the testpage is the page where you want to redirect page.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Thanks for your reply.
But Actually my problem is different ,i dont want to redirect from one page to another page in the same project.Instead of that ,i want to redirect from one website to another site...for example www.yahoo.com to www.rediffmail.com
|
|
|
|
|
it will work. please try it. it is working fine for me.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Thanku very much for your confident reply
I try Response.redirect withot using http in first time
But after your reply i try with http (ie,Response.redirect("http://www.xyz.com");
now my case is working fine.
Thanks once again
|
|
|
|
|
Glad to help always.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
hello ,
In the button there will be one property onclientclick.
on clientclick = javascript:redirectpage();
function redirectpage()
{
navigate('http://www.rediffmail.com');
return false;
}
Do like this it will work
ok byeee
Murali
|
|
|
|
|
Hi,
I'm currently pulling out my hair with what can only be described as completely random Unhandles Exception errors. They don't occur all of the time, but seem to when I need them not too, i.e. in front of colleges and not even custom errors catch them for some reason.
They appear to occur when connecting to databases, and I cringe everytime I see my application attempt to connect to one. There is litterally no other information I can give because I simply don't get any.
It can't be my code because sometimes it works and sometimes it doesn't. (I'm using MS Access). I've tried asking my host and they brush it off and say we can get our technicians to have a look, for £60 per half hour... this is Fasthosts who are a complete waste of time.
Any ideas?
Thanks
|
|
|
|
|
Aaron Hudson wrote: There is litterally no other information I can give because I simply don't get any.
Then you have to make sure that you get it. The excpetion contains a lot of information on where and why it was thrown. Without that information, the best anyone can give you is guesswork.
Any code that depends on something that you don't have full control over, should have it's own error handling. When you catch the exception, you can display all the information in it.
---
single minded; short sighted; long gone;
|
|
|
|