|
Hello ,
I try with "&" also Before your suggetion with & operator....But the same error comes still.....
my problem is that...How can i retrieve each query string value
li=<%#DataBinder.Eval(Container.DataItem,"AD_TITLE") %>&type=<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>&price=<%# DataBinder.Eval(Container.DataItem,"PRICE")
With these coding ,it will work or not????
string search,type1,price;
search=Request.QueryString["li"].ToString();
type1=Request.QueryString["type"].ToString();
price=Request.QueryString["price"].ToString();
Label1.Text=search;
string sstr="select * FROM ads where AD_TITLE='"+search+"'&& AD_TYPE='"+type1+"' && PRICE='"+price+"' ";
sdr=conobj.reader(sstr);
while(sdr.Read())
{
}
what is my mistake ...????Please help me....
with regards and thanks
Biju
|
|
|
|
|
Okay. Lets debug the application..
Let's say we have two pages called page1 and page2. We will divide the issue into small pieces ~
1. Using static data in page1
2. Retrieving the data in page2
3. Checking whether the SQL statment is correct or not
4. Changing static data to dynamic data in page1.
1. Using static data in page1
We will remove all dynamic value in A link to avoid NULL value and "".
Note: dynamic value means <%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>.
<a href="http://localhost/approvedplotfinal/classified/page2.aspx?li=<%#DataBinder.Eval(Container.DataItem,"AD_TITLE") %>,type=<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>,price=<%# DataBinder.Eval(Container.DataItem,"PRICE") %>"><br />
<%# DataBinder.Eval(Container.DataItem,"AD_TITLE") %><br />
</a><br />
We will replace all dynamic value with all static value.
<br />
<a href="http://localhost/approvedplotfinal/classified/page2.aspx?li=mytitle&type=mytype&price=100" ><br />
<%# DataBinder.Eval(Container.DataItem,"AD_TITLE") %><br />
</a>
Run the application to check whether there is any error or not.
2. Retrieving the data in page2
Forget about other code in page2. We will assume that we have only the following lines in Page Load.
search=Request.QueryString["li"].ToString();
type1=Request.QueryString["type"].ToString();
price=Request.QueryString["price"].ToString();
- Set the breakpoint at "search" variable.
- Run the application. (Page1 is start-up page)
- Click the link in page1. (it will take you to page2.)
- Check whether "Request.QueryString["li"] " is null or not.
- Check whether "Request.QueryString["type"] " is null or not.
- Check whether "Request.QueryString["price"] " is null or not.
Note: All three parameters should not be NULL. If you are getting NULL then let me know.
3. Checking whether the SQL statment is correct or not
Which Database are you using? If it's SQL Server, you don't need "&&".
string sstr="select * FROM ads where AD_TITLE='"+search+"'&& AD_TYPE='"+type1+"' && PRICE='"+price+"' ";<br />
So, we will change something like that.
string sstr="select * FROM ads where AD_TITLE='" + search + "' AND AD_TYPE = '" + type1 + "' AND PRICE='"+ price + "'";<br />
- Check this variable "sstr" in Quick Watch or Immediate Window.
- Copy the string from Quick Watch or Immediate Window.
- Paste in Query Analyzer and Run it.
(You should not get any error. this is about checking whether the SQL statement is correct or not.)
4. Changing static data to dynamic data in page1.
It is still working fine. we will remove the static code in page and replace with dynamic code.
So, the following code will be used again..
<a href="http://localhost/approvedplotfinal/classified/page2.aspx?li=<%#DataBinder.Eval(Container.DataItem,"AD_TITLE") %>,type=<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>,price=<%# DataBinder.Eval(Container.DataItem,"PRICE") %>"><br />
<%# DataBinder.Eval(Container.DataItem,"AD_TITLE") %><br />
</a><br />
- Run the application
- Click the link in page1.
- Check the Request.QueryString and SQL Statement in page2.
if it's working until now, you are done..
Please follow the step as I mention here.. let me know the result..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hai,
sorry for delay...
It is very helpful....i done as per your information...it is working fine Now my problem solved...Thanks alot.....But Now arise a new problem..How to set paging in this.???...Please give any idea or sample code.....
instead of "," i use '&'in this code......it is very helpful
-----------------------------------------------------------------------------
<a href="http://localhost/approvedplotfinal/classified/page2.aspx?li=<%#DataBinder.Eval(Container.DataItem,"AD_TITLE") %>,type=<%# DataBinder.Eval(Container.DataItem,"AD_TYPE") %>,price=<%# DataBinder.Eval(Container.DataItem,"PRICE") %>">
<%# DataBinder.Eval(Container.DataItem,"AD_TITLE") %>
</a>
-----------------------------------------------------------------------------
thanks once again
Biju
|
|
|
|
|
|
Hai
How to edit and update a particular DataList item??
Thanks and regards
Biju
|
|
|
|
|
bijeshputhalath wrote: How to edit and update a particular DataList item??
If you wanna do inserting, editing and deleting the record, I would suggest you to use "DataGrid" or "GridView" control instead of "DataList".
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi,
I am developed a application as multiple image uploading.
I browse the image and add path of this in listbox.then click on upload button to upload the images. So I want to create thmbnail images on web page while adding the images paths to the listbox.
thanks
|
|
|
|
|
tulsulkar wrote: create thmbnail images on web page while adding the images paths to the listbox.
Use GetThumbnail() method in Image class
|
|
|
|
|
|
Sure.
How To: Creating Thumbnail Images
<br />
System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath(file));<br />
<br />
System.Drawing.Image thumbnailImage = image.GetThumbnailImage(64, 64, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);<br />
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi Friends,
i m using FileUpload Control in my page
now i want, user not able to upload .exe file
for that i need to specify filter fo extensions
how do i Filter extensions???
thanks
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
No. AFAIK, it's not possible to do that with File Upload control. maybe. you may look around flash or ActiveX control.. I'm sure that HTML file control doesn't have that feature. So, you will have to check the extension at code-behind.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Amit.Amit.Amit..... wrote: now i want, user not able to upload .exe file
for that i need to specify filter fo extensions
Specifying filter is not possible in file upload control. But you can check the file extension like this and alert user regarding that
if (File1.PostedFile.FileName.EndsWith(".exe"))
{
}
else
|
|
|
|
|
Use javascript for the validations since u cant filter the HtmlInputFile control.
Ask if u want the code u have 2 do it in the onchange method.
|
|
|
|
|
Use javascript for the validations since u cant filter the HtmlInputFile control.
Ask if u want the code. u have 2 do it in the onchange method.
|
|
|
|
|
you should use this code:
private bool IsAccept(string fileName)
{
bool ok = false;
string ext = System.IO.Path.GetExtension(fileName);
if (ext == ".jpe" || ext == ".jpeg" || ext == ".pjpeg" || ext == ".gif"
|| ext == ".jpg" || ext == ".bmp" || ext == ".png" || ext == ".x-png")
{
ok = true;
}
return ok;
}
Hope that help you!
vtkiet05
|
|
|
|
|
javascript cannot interact with the input control, or the file system, AFAIK.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I guess the code vtkiet05 shows us is Server-side code. not Javascript. I believe that that code is not interacting with File System. It's just trying to get the extension of file by using System.IO.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
|
hi Guys
Is there any live application to search for code, we have lots n lots of sites to get the source codes, why cant we make a web application with a good search engine to search pure text source code, anything related to code.
For eg. store procedure's, HTML, ASP codes, technical text, code-behind, javascript, java codes,
only pure text should be stored, its should be a very simple application with no links, only to maintain and retrieve, there will be no data editing for the users.
uploading of files are not allowed since many technical websites are providing this feature,
The plan
Here the users can store information taken from the internet(pure text) when he/she visits for reference, later he/she need not come to this same link to take the specific code, instead he/she can search the code in this new Code Manager portal,
the user will have to provide the description of code or technical text and each source code should be allocated under different sets,
for eg. if its HTML code, the language should be set as HTML for this source code
How the search works
A search with different criteria should be given..
based on desciption
based on language
based on date stroed
based on unique words,
base on tags
we should make this application very simple to handle
winnie
|
|
|
|
|
I don't think we need that. We already have Google. I don't even use Google Code Search. Web Search and Blog search are good enough...
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
even i understand that.. since Google is the mother of all searches ,
but here in code manager it be will used as a follow up, coz the user who's going to search for a code can be very sure that code will exists coz this portal will be used by coders,, there will no other link to browse around. its like having a reference just like a what a LIBRARY does
regards
winnie
|
|
|
|
|
codelinks wrote: Here the users can store information taken from the internet(pure text) when he/she visits for reference, later he/she need not come to this same link to take the specific code, instead he/she can search the code in this new Code Manager portal,
Violation of copyright laws.
Moreover your question has nothing related with ASP.NET. Better forum would be Lounge.
|
|
|
|
|
Spamming the whole site won't win you any friends.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi codelink,
Don't say like that here. dude.
"Christian" is the one who is always helping to solve other people's problems here.
From our point of view, the way you are doing is not good.
Be careful. friend. Enjoy!
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|