Showing posts with label articles. Show all posts
Showing posts with label articles. Show all posts

Saturday, February 25, 2012

Creating a custom word-breaker and stemmer

Does anyone know of any links to articles or information on creating a
custom word-breaker and stemmer for full-text search on SQL 2005?
In the meantime I'll keep Googling.
Thanks
Microsoft.com has some articles.
http://msdn2.microsoft.com/en-gb/library/ms691035.aspx
http://msdn2.microsoft.com/en-us/library/ms916793.aspx
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Mike C#" <xyz@.xyz.com> wrote in message
news:e5e4OywPHHA.3344@.TK2MSFTNGP02.phx.gbl...
> Does anyone know of any links to articles or information on creating a
> custom word-breaker and stemmer for full-text search on SQL 2005?
> In the meantime I'll keep Googling.
> Thanks
>
|||"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:%23IUb7byPHHA.856@.TK2MSFTNGP05.phx.gbl...
> Microsoft.com has some articles.
> http://msdn2.microsoft.com/en-gb/library/ms691035.aspx
> http://msdn2.microsoft.com/en-us/library/ms916793.aspx
Thanks Hilary. BTW the folks here at work want to start doing some
full-text searching on certain items, and I've pointed them to your articles
for answers to a lot of their questions. Do you have a book on it, and if
so where can I get a copy?
Thanks again
|||The book is as yet unpublished.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Mike C#" <xyz@.xyz.com> wrote in message
news:OmbJ0czPHHA.2312@.TK2MSFTNGP04.phx.gbl...
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:%23IUb7byPHHA.856@.TK2MSFTNGP05.phx.gbl...
> Thanks Hilary. BTW the folks here at work want to start doing some
> full-text searching on certain items, and I've pointed them to your
> articles for answers to a lot of their questions. Do you have a book on
> it, and if so where can I get a copy?
> Thanks again
>
|||Please post when it's out, we could definitely use it.
Thanks
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:ubTWVadQHHA.4276@.TK2MSFTNGP02.phx.gbl...
> The book is as yet unpublished.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "Mike C#" <xyz@.xyz.com> wrote in message
> news:OmbJ0czPHHA.2312@.TK2MSFTNGP04.phx.gbl...
>
|||Mike I had a contract with Apress to put one out several years ago - it
focused on Indexing Services. I wrote 912 pages and then .Net happened. I
then got more interested in replication and never updated it for .Net. Nor
did I complete a chapter on SharePoint. I just don't think the demand is
there for a book on search at this time. NWSU did express an interest in it
as well, but I really have moved on to other things.
If you want to read the 912 pages just ask. I wrote a chapter on SQL FTS
2005 for SQL Server 2005 Bible, but it was based on the late betas/CTPs, and
SP 1 brought a few changes.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Mike C#" <xyz@.xyz.com> wrote in message
news:u8$Z40vQHHA.496@.TK2MSFTNGP06.phx.gbl...
> Please post when it's out, we could definitely use it.
> Thanks
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:ubTWVadQHHA.4276@.TK2MSFTNGP02.phx.gbl...
>
|||I would LOVE to read the 912 pages. Can you email it to me?
jsheehan@.groceryshopping.net
"Hilary Cotter" wrote:

> Mike I had a contract with Apress to put one out several years ago - it
> focused on Indexing Services. I wrote 912 pages and then .Net happened. I
> then got more interested in replication and never updated it for .Net. Nor
> did I complete a chapter on SharePoint. I just don't think the demand is
> there for a book on search at this time. NWSU did express an interest in it
> as well, but I really have moved on to other things.
> If you want to read the 912 pages just ask. I wrote a chapter on SQL FTS
> 2005 for SQL Server 2005 Bible, but it was based on the late betas/CTPs, and
> SP 1 brought a few changes.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "Mike C#" <xyz@.xyz.com> wrote in message
> news:u8$Z40vQHHA.496@.TK2MSFTNGP06.phx.gbl...
>
>
|||Me too, sent you an email Hilary. Thanks!
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:ehwe9w0QHHA.4476@.TK2MSFTNGP05.phx.gbl...
> Mike I had a contract with Apress to put one out several years ago - it
> focused on Indexing Services. I wrote 912 pages and then .Net happened. I
> then got more interested in replication and never updated it for .Net. Nor
> did I complete a chapter on SharePoint. I just don't think the demand is
> there for a book on search at this time. NWSU did express an interest in
> it as well, but I really have moved on to other things.
> If you want to read the 912 pages just ask. I wrote a chapter on SQL FTS
> 2005 for SQL Server 2005 Bible, but it was based on the late betas/CTPs,
> and SP 1 brought a few changes.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "Mike C#" <xyz@.xyz.com> wrote in message
> news:u8$Z40vQHHA.496@.TK2MSFTNGP06.phx.gbl...
>

Sunday, February 19, 2012

CreateUserWizard - Stored Procedure

Im trying to make an "createaccount-page" and followed this guide:http://aspnet.4guysfromrolla.com/articles/070506-1.aspx

The problem is that I want to use a stored procedure instead...But Iam getting this message when pushing the create-button:

"Procedure or function usp_MyProcedure has too many arguments specified"

My stored procedure look like this: (maybe something is wrong here?)

ALTER PROCEDURE

usp_MyProcedure

(

@.UserID

uniqueidentifier OUTPUT,

@.FName

varchar(50),

@.LName

varchar(50),

)

AS

INSERT INTO MyTable (UserID, FName, LName,)Values

(@.UserID, @.FName, @.LName)

RETURN

My sqldatasource:

<asp:SqlDataSourceID="InsertExtraInfo"runat="server"ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString %>"ProviderName="<%$ ConnectionStrings:ASPNETDBConnectionString.ProviderName %>"InsertCommand="usp_MyProcedure"InsertCommandType="StoredProcedure"><InsertParameters><asp:ControlParameterName="FName"Type="String"ControlID="tboxFName"PropertyName="Text"/><asp:ControlParameterName="LName"Type="String"ControlID="tboxLName"PropertyName="Text"/></InsertParameters></asp:SqlDataSource>The code behind-file is the same as the one in the article...

Ok..Now I dont understand...because I have the same sql-code as they use...(I wait with the stored procedure until it first works)....

Everything is saved in the database, but I get this message: "The variable name '@.UserId' has already been declared. Variable names must be unique within a query batch or stored procedure"

My sqldatasource look like this now:

<

asp:SqlDataSourceID="InsertExtraInfo"runat="server"ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString %>"ProviderName="<%$ ConnectionStrings:ASPNETDBConnectionString.ProviderName %>"InsertCommand="INSERT INTO [MyTable] (UserId, FName, LName) VALUES (@.UserID, @.FName, @.LName)"><InsertParameters><asp:ControlParameterName="FName"Type="String"ControlID="tboxFName"PropertyName="Text"/><asp:ControlParameterName="LName"Type="String"ControlID="tboxLName"PropertyName="Text"/></InsertParameters></asp:SqlDataSource>|||

Where is your code to get the value for your UserId InsertParameter?

You need something like this in your code for inserting:

...

InsertExtraInfo.InsertParameters.Add("UserId", System.GUID.NewGuid().ToString());
InsertExtraInfo.Insert();

...

|||

Because I didnt get this to work, I choosed to use profiles instead...I use this code in my code-behind-file:

Protected

Sub CreateUserWizard1_CreatedUser(ByVal senderAsObject,ByVal eAs System.EventArgs)Handles CreateUserWizard1.CreatedUser

' Create an empty Profile for the newly created userDim ProfileAs ProfileCommon =CType(ProfileCommon.Create(CreateUserWizard1.UserName,True), ProfileCommon)' Populate some Profile properties off of the create user wizard

Profile.FirstName =

CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("tboxFNamn"), TextBox).Text

Profile.LastName =

CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("tboxLNamn"), TextBox).Text' Save the profile - must be done since we explicitly created this profile instance

Profile.Save()

EndSub' Activate event fires when the user hits "next" in the CreateUserWizardPublicSub AssignUserToRoles_Activate(ByVal senderAsObject,ByVal eAs EventArgs)' Databind list of roles in the role manager system to a listbox in the wizard

AvailableRoles.DataSource = Roles.GetAllRoles

AvailableRoles.DataBind()

EndSub' Deactivate event fires when user hits "next" in the CreateUserWizardPublicSub AssignUserToRoles_Deactivate(ByVal senderAsObject,ByVal eAs EventArgs)' Add user to all selected roles from the roles listboxDim iAsInteger = 0DoWhile (i < AvailableRoles.Items.Count)If (AvailableRoles.Items(i).Selected =True)Then

Roles.AddUserToRole(CreateUserWizard1.UserName, AvailableRoles.Items(i).Value)

EndIf

i = (i + 1)

LoopEndSub

..The values from the textboxes is correctly saved in the table (aspnet_Profile), but the roles is not saved in aspnet_UsersInRoles..(for it should be saved there right?)...

Becuase the listbox called "AvailibleRoles" shows the all roles that the "new user" could use...And that role needs to be saved somewhere..(I think in the aspnet_UsersInRoles)...But its not saved there...

So what should I do to save it?