|
you're talking about basic SQL here. Do you own any books on SQL ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Yes, i have some books but none of them explain how to build search engine....if you talk about the select parameters, i think i know what to write
ALTER PROCEDURE dbo.advancedSearching
@indexKindword varchar(250) = NULL,
@indexKindword2 varchar(250) = NULL,
@indexKindword3 varchar(250) = NULL
AS
BEGIN
SELECT [companiesIndex].indexCatID, [companiesIndex].compantName, [companiesIndex].companyAddress, [companiesIndex].companyState, [companiesIndex].companyCity, [companiesIndex].companyPhone, [companiesIndex].companyFax, [companiesIndex].companyWebsite, [companiesIndex].keyWords
FROM companiesIndex
WHERE ([companiesIndex].cat LIKE '%' + @indexKindword + '%' OR [companiesIndex].cat IS NULL
AND [companiesIndex].companyState LIKE '%' + @indexKindword2 + '%' OR [companiesIndex].companyState IS NULL
AND [companiesIndex].companyCity LIKE '%' + @indexKindword3 + '%' OR [companiesIndex].companyCity IS NULL)
ORDER BY [compantName]
END
RETURN
but i dont know how to handle the results in the aspx.cs page (i know how to handle one parameter search)
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["searchString"] != null)
{
DisplaySearchResults(Request.QueryString["searchString"]);
Label50.Text = Repeater1.Items.Count.ToString();
}
}
public void DisplaySearchResults(string strSearch)
{
SqlConnection newconn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ASPNETDBConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand("spSearchByString", newconn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@SearchString", strSearch);
newconn.Open();
Repeater1.DataSource = cmd.ExecuteReader();
Repeater1.DataBind();
newconn.Close();
newconn.Dispose();
}
How you translate this page to get 3 parameters?
|
|
|
|
|
I have already written one this month. Just have a look..
See the signature below to find it.
|
|
|
|
|
Ohh... you might be asking for how to search using SQL ??
is this is so, read basic books on SQL.
Let me give you one instance on how the query look like:
Say you want to search name, state and city based on variables. If variables doesnt have value, your search doesnt need to hamper. Do like this :
SELECT * FROM TABLE
WHERE (CASE WHEN ISNULL(@P_NAME,'') = '' THEN '' ELSE NAME END)= ISNULL(@P_NAME,'')
AND (CASE WHEN ISNULL(@P_CITY,'') = '' THEN '' ELSE CITY END)= ISNULL(@P_CITY,'')
AND (CASE WHEN ISNULL(@P_STATE,'') = '' THEN '' ELSE STATE END)= ISNULL(@P_STATE,'')
Note : It could be optimized.
Thus if you ask
@P_Name = 'xxx'
@P_CITY = NULL
@P_STATE = 'yyyy'
It will not consider @P_CITY as search criteria..
Hopefully this gives you an idea.
|
|
|
|
|
Crystal Reports problem in .Net 2.0 showing blank pages after few hours
problem always resolve after restarting IIS
Please note that many users access application at a time.
please suggest any permanent solution
|
|
|
|
|
hammadahsan wrote: problem always resolve after restarting IIS
Why Would you do tht..!IIS should run at background..!If You restart the IIS..!i.e. you a re restarting the application..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Because this is the only way to fix this problem.
|
|
|
|
|
I think the problem might be with memory.
Try to see what you are placing into Session or application when you call the Crystal Report. I think the memory is not cleared properly when reports are opened.. and thus killing the solution..
You can also use Separate Application pool area rather than using the shared one to ensure have more memory.
But you should really look into the memory management for your solution.
|
|
|
|
|
Either your application is getting killed or your database (or both). Your solution does not scale up properly to accommodate more simultaneous users. To find out a "permanent" solution, you need to first find out where the problem is and what the problem is.
|
|
|
|
|
Good Day All
I have a ASP.NET app. There is a button one of the pages. I have placed a Break point in the Click event and when i click the Button it does not even go to the Break Point it shows this
http://www.tiyaneproperties.co.za/SSIS/Strange.jpg[^]
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Is the URL shown correct ? Are you connected to the web ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Good Day
The URL is Correct. When the Button is Clicked this will import the xml File. This works in other Browsers. yes am Connected to web.
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Import an XML file from where ? Have you put a breakpoint in page load to see if any of your code is run ? What if you refresh the page when it fails ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
When the Page load the the Break point works and when i click the Button, it gave that strange page. When i refresh the page, it goes back.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
That is the First thing i did when i got this problem. I have resolved the Problems. The File that i wanted to import when that button is Clicked was too big. So i have resolved this by adding the Following entry in the web config in the System.web Section
< httpRuntime maxRequestLength="102400" />
Thanks once more time
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Are you submitting the page to a location using form action
or have you manually modified your form onsubmit event ?
|
|
|
|
|
here is my page definition am not sure what is wrong this works on other machines
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ImportTimetable.aspx.cs" Inherits="ImportTimetable" Title="o!Booking Version 3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<span>
<br />
<table border="0" cellpadding="2" cellspacing="0" style="font-family: Verdana">
<tr>
<td style="width: 72px">
<asp:Image ID="Image1" runat="server" Height="72px" ImageUrl="~/Images/CDICons/timetable72.png"
Style="behavior: url(PngBehaviour.htc)" Width="72px" /></td>
<td>
</td>
<td style="width: 600px">
<span style="font-size: 13pt"><strong>Import Timetables<br />
</strong><span style="font-size: 8pt">Perform bulk bookings for class and/or exam timetables.
For a description of the file formats, see the online help.</span></span></td>
</tr>
</table>
<span style="font-family: Verdana">
<hr align="left" width="800" />
<br />
</span></span>
<table border="0" cellpadding="0" cellspacing="0" style="font-size: 10pt; width: 82%;
font-family: Verdana">
<tr>
<td style="width: 195px; height: 22px;" valign="top">
Import Timetable</td>
<td style="height: 22px">
<asp:FileUpload ID="FileUploadTimetable" runat="server" Width="421px" />
<asp:Button ID="btnImport" runat="server" BackColor="Transparent" BorderStyle="None"
Font-Names="Verdana" Font-Size="10pt" OnClick="btnImport_Click" Text="[Import]"
Width="64px" />
<br />
</td>
</tr>
</table>
<br />
<span style="font-size: 10pt; font-family: Verdana">
<asp:Label ID="lblStatus" runat="server" Font-Names="Verdana" Font-Size="10pt" ForeColor="#8080FF"
Width="100%"></asp:Label><br />
</span>
</asp:Content>
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I got the Solution. please check the Reply to colin
Thanks for your time
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
you are most welcome ...
so it is the problem with Response size ..
|
|
|
|
|
Yes
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
The problem is not with the response size, it is with the request size, which is by default 4MB, if you try to upload anything greater than that, your request is simply denied and you get this strange behavior.
|
|
|
|
|
Just a slip while writing.
Should be Request...
|
|
|
|
|
Hello friends,
The site I am working on, is affected by a malicious script. Actually it is always added at the end of the inline code. If it is a html page, then there will not be problem in opening the page. But if the page is using master page and when it is added at the end on the inline code i.e outside the content tag, then there will be a parser error saying that " Only Content controls are allowed directly in a content page that contains Content controls."
Now my question is , Is there any way to block these types of malicious scripts being added in the inline code.
I should tell you that I googled a lot and gathered some of the articles from the msdn site showing the security measures to avoid these scripts. I worked accordingly and did all the steps like validating the user input, validating the query string, validate request property in the web.config etc...
Also I contacted the server guys. But they are saying that it is coming from the browser i.e they are pointing the arrow towards the coding part.
I dont know where I am lacking. Please assist me.
cheers,
sneha
|
|
|
|
|
sneha Choudhary wrote: Now my question is , Is there any way to block these types of malicious scripts being added in the inline code.
There is obviously a process on your computer that's doing this, buy some good anti virus software and use it.
sneha Choudhary wrote: Also I contacted the server guys. But they are saying that it is coming from the browser i.e they are pointing the arrow towards the coding part.
Well, I've found that godaddy, for instance, will claim that there is a code issue, no matter how well you can prove it's not true. So, not sure what to say there. They are almost certainly wrong/clueless. If they run the server, they have the virus, simple as that.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
please check the case of <asp:content> tag
I have fixed this error by simply changing the case on my page.
it should be <asp:content>
|
|
|
|