|
Hi..
I have used Full-Text Search in a stored procedure with English words whithout any problems..But when i use it with Arabic words it gives me THE Error:
Server: Msg 7619, Level 16, State 1, Procedure SearchProject, Line 19
Execution of a full-text operation failed. A clause of the query contained only ignored words.
The stored procedure :
CREATE PROCEDURE SearchProject
(
@SearchString nvarchar(500),
@CultureName nvarchar(50),
@HowManyResults int OUTPUT
)
AS
CREATE TABLE #SearchTable
(
FieldNO int,
ProjectNO int,
ProjectName nvarchar(200),
ProjectDescription nvarchar(1000),
ProjectImage nvarchar(1000),
CultureID int
)
INSERT INTO #SearchTable (FieldNO,ProjectNO,ProjectName,ProjectDescription,ProjectImage,CultureID)
SELECT P.FieldNO, PL.ProjectNO,PL.ProjectName,PL.ProjectDescription,P.ProjectImage,PL.CultureID
FROM FREETEXTTABLE(Project_Locale,*,@SearchString) AS FT JOIN Project_Locale AS PL ON FT.[KEY]=PL.ProjectCultureID
JOIN Project AS P ON P.ProjectNO=PL.ProjectNO
WHERE PL.CultureID=dbo.GetCultureID(@CultureName)
INSERT INTO #SearchTable (FieldNO,ProjectNO,ProjectName,ProjectDescription,ProjectImage,CultureID)
SELECT P.FieldNO, PL.ProjectNO,PL.ProjectName,PL.ProjectDescription,P.ProjectImage,PL.CultureID
FROM Project_Locale AS PL ,Project AS P,
ProjectField_Locale AS FL,
FREETEXTTABLE(ProjectField_Locale,*,@SearchString) AS FT2
WHERE FL.FieldNO=P.FieldNO
AND FL.FieldCultureID=FT2.[KEY]
AND PL.ProjectNO=P.ProjectNO
AND PL.CultureID=dbo.GetCultureID(@CultureName)
AND FL.CultureID=dbo.GetCultureID(@CultureName)
INSERT INTO #SearchTable (FieldNO,ProjectNO,ProjectName,ProjectDescription,ProjectImage,CultureID)
SELECT P.FieldNO, PL.ProjectNO,PL.ProjectName,PL.ProjectDescription,P.ProjectImage,PL.CultureID
FROM Project_Locale AS PL ,Project AS P,
Feature_Locale AS PFEA,
ProjectFeature AS FP,
Feature AS F,
FREETEXTTABLE(Feature_Locale,*,@SearchString) AS FT3
WHERE FT3.[KEY]=PFEA.FeatureCultureID
AND FP.ProjectNO=P.ProjectNO
AND FP.FeatureNO=PFEA.FeatureNO
AND PL.ProjectNO=P.ProjectNO
AND F.FeatureNO=PFEA.FeatureNO
AND PFEA.CultureID=dbo.GetCultureID(@CultureName)
AND PL.CultureID=dbo.GetCultureID(@CultureName)
SELECT @HowManyResults=COUNT(DISTINCT ProjectNO) FROM #SearchTable
SELECT DISTINCT * FROM #SearchTable
RETURN
GO
I called the stored procedure using the following(in the Query Analayzer) :
USE nabeel1eagle
DECLARE @HowManyResults int
EXEC SearchProject 'ملفات','ar-SA',@HowManyResults OUTPUT
but when I use the previous code directly(without calling the stored procedure using EXEC) in the Query Analyzer it works fine.Like the following (part of the code)code:
SELECT P.FieldNO, PL.ProjectNO,PL.ProjectName,PL.ProjectDescription,P.ProjectImage,PL.CultureID
FROM FREETEXTTABLE(Project_Locale,*,'ملفات') AS FT JOIN Project_Locale AS PL ON FT.[KEY]=PL.ProjectCultureID
JOIN Project AS P ON P.ProjectNO=PL.ProjectNO
WHERE PL.CultureID=dbo.GetCultureID('ar-SA')
Could any one help and tell me how to solve this problem?
"I am too late but i will never give up"
|
|
|
|
|
I want to see datagrid demo on latest realesed VS2005 or Asp.net. If any body have reply me.
|
|
|
|
|
Get the sample code from the site[^], then run in VS 2005. The ASP.NET 2.0 with VS 2005 supports backward compatibility, so if you have the sample code with datagrid running on the ASP.NET 1.x, then it should be working fine with the version 2.0. Or do you mean the GridView[^] control which is the successor of the datagrid control.
|
|
|
|
|
I have created a new WebControlLibrary. What i would like is to create a mouse hover event on the control but i have no idea how to achieve this behaviour. Is it possible to create mouse events on a custom control and how would it be done ?
|
|
|
|
|
What does your custom control look like? What does it do? How do you want to use the mouse events with your custom control? Basically, you can simply attach the mouse events to the Attribute collection of a child control of the custom control, if you are developing a composite control. If you create a rendered control, you can manage to do that in the overriden Render method. You can see the MSDN[^] for more information.
|
|
|
|
|
Well the control doesn't look like anything yet. It's just a new WebControlLibrary, i have set the backcolor so i can see it in the webpage, what i would like is when i hover the mouse over the control the event is triggered.
|
|
|
|
|
Piovra_ wrote: It's just a new WebControlLibrary, i have set the backcolor so i can see it in the webpage, what i would like is when i hover the mouse over the control the event is triggered.
Do you mean it's just a default control added to the project when you create a new web control library? When you hover the mouse over the control, you want the event to be triggered, so do you mean the onmouseover event or a custom event defined in the control. If it is simply the onmouseover event, you can add the onmouseover="alert();" to the control declaration on the web page.
|
|
|
|
|
Why does the repeater always change the name attributes of my checkboxes???? What the crap? how do I stop this? It keeps making them unique whent they should be identical..
/\ |_ E X E GG
|
|
|
|
|
Alex,
In the ASP.NET, any control should always be uniquely identified, so by default the id of the control within the scope of a naming container contains the id of its container. In the case of the repeater, the id of the checkboxes contains the id of the RepeaterItem, and the ASP.NET automatically does that for you. If you want this thing not to happen to the checkboxes, you may consider using the html checkbox input element which is not marked with the runat="server" .
|
|
|
|
|
oh the runat is doing it, thanks.
/\ |_ E X E GG
|
|
|
|
|
Actually, I'm kinda confused. So, I'll just keep my checkbox as runat=server.
But I'm confused on how I can access the checkbox from my code behind file....
Any tips?
/\ |_ E X E GG
|
|
|
|
|
eggie5 wrote: So, I'll just keep my checkbox as runat=server.
Yes, leave the checkbox marked with the runat="server".
eggie5 wrote: But I'm confused on how I can access the checkbox from my code behind file....
The sample code below shows you a way to access the checkbox in code-behind:
foreach (RepeaterItem item in Repeater1.Items)
{
CheckBox chkBox = item.FindControl("chkBox") as CheckBox;
if (chkBox != null)
{
....
}
} Depending which control you are using, you can choose the line with the CheckBox or the HtmlInputCheckBox control. In addition to the FindControl method, you can also access the checkbox control using the Controls collection.
|
|
|
|
|
I notice you only use "chkBox" for the checkbox ID, was this just for the example? I'm going to have to build the id dynamically right?
/\ |_ E X E GG
|
|
|
|
|
You name the checkbox as chkBox , or whatever you like, and you can use it later with the FindControl method. Also, you should bind data to the value attribute of the checkbox instead of the id of the control.
|
|
|
|
|
it seems as though the Items collection is all null...
/\ |_ E X E GG
|
|
|
|
|
foreach (RepeaterItem item in RepeaterCurrentAbstracts.Items)
do you have any idea why all my items would be null?
/\ |_ E X E GG
|
|
|
|
|
When/where do you run this code? It's before or after the datasource is bound to the control ( or the control hierarchy is built)? Btw, below is a quick example:
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Hashtable datasource = new Hashtable();
datasource.Add("key1", "value1");
datasource.Add("key2", "value2");
datasource.Add("key3", "value3");
datasource.Add("key4", "value4");
datasource.Add("key5", "value5");
Repeater1.DataSource = datasource;
Repeater1.DataBind();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
foreach (RepeaterItem item in Repeater1.Items)
{
CheckBox chkBox = item.FindControl("chkBox") as CheckBox;
if (chkBox != null && chkBox.Checked)
Response.Write("Selected value: " + chkBox.Attributes["value"] + "<br>");
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkBox"
Text='<%# DataBinder.Eval(Container.DataItem, "Value") %>'
Value='<%# DataBinder.Eval(Container.DataItem, "Key") %>' />
<br />
</ItemTemplate>
</asp:Repeater>
<br />
<asp:Button ID="Button1" runat="server" Text="Push Me" On_Click="Button1_Click" />
</div>
</form>
</body>
</html>
|
|
|
|
|
HMMM... I don't know what the deal is but the debugger said the Items were null, but apparently it is working... Kinda...
I have a quick question on state. So I am on my webpage and check a checkbox and then click a button which runs a method in my code behind (so it posts back). I should have access to that checked using the FindControl code above right? Or is the state lost between the postback? Do I have to save the checkbox state somehow and then re set them?
/\ |_ E X E GG
|
|
|
|
|
eggie5 wrote: So I am on my webpage and check a checkbox and then click a button which runs a method in my code behind (so it posts back). I should have access to that checked using the FindControl code above right?
Yes.
eggie5 wrote: Or is the state lost between the postback?
No.
eggie5 wrote: Do I have to save the checkbox state somehow and then re set them?
No. The checkbox control knows how to save its checked status. In fact, the checkbox control updates its checked property at the server side based on it's postback data. If the checkbox is checked, its value is submitted to the server, and the control can gets the value when the post data is loaded (in the LoadPostData method). If the checkbox is not checked, data is not sent to the server, and based on this postback data, the control knows how to set the Checked property accordingly.
|
|
|
|
|
Hi all,
how to assign value to input file type tag.
i.e
i want to assign value to the control. when i give
file.value="india.gif"
it shows a error..
how to solve it. Pls help mee.
thanks
Paul
|
|
|
|
|
Paul,
The value property of the input file[^] element is read-only and does not have the default value, so you cannot set the default value for it.
|
|
|
|
|
Hi Paul,
The value of HTMLInputFile is not settable due to the security reasons. The value property of this control is readonly.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi,
I want to update the datagrid control, present in the parent page, from the child page without the page getting fully refreshed. Is there some way with which i can update the datagrid control without full page refresh?
Ashu
|
|
|
|
|
Hi,
You can use frames for that purpose.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks Apurva...but i heard about something called 'scriptcallback'. this technique helps to update a single control on the page without full page reload. I have used 'scriptcallback' but only for html controls and not for asp.net server controls. Any idea?
Ashu
|
|
|
|
|