Showing posts with label informations. Show all posts
Showing posts with label informations. Show all posts

Friday, February 24, 2012

Aspnet_Profile data extraction

Hello,

in the new aspnet 2, there is a table called Aspnet_Profile wich contains user informations.

Look at the way they are filled

c9d365eb-6981-4c12-bfb8-e9b17445b26d Name:S:0:11:phone:S:11:9: William DOE567876567 <Binary data> 05/10/2005 12:27 35207ce2-8368-4914-95d7-2e0f51414d9c Name:S:0:8:phone:S:8:9: John DOE567876567 <Binary data> 05/10/2005 12:27


The first column is the UniqueIdentifier of user
The second is PropertyNames which contains the structure of the informations. For example here for the first line :
Name is a string wich begins at 0 and is 11 long
Phone is a string wich begins at 11 and is 9 long

The third column contains the informations

then you have here :
Row 1 :
Name : William DOE
Phone: 567876567

Row 2 : John DOE
Phone: 567876567

my problem is to be able to access those informations with a stored procedure.

Can Anyone help me ? thanks a lotYou can write a write a TSQL table-valued UDF that can split the formatted property names and get the lengths. You can then use the offset/lengths with SUBSTRING to get the actual values. The final casting can be done based on the type. But why are you trying to access this information in a SP? What happens if the next service pack or hotfix for .NET changes some of these formats? Maybe if you post what you are trying to do in the .NET newsgroup they will be able to suggest other ways to get the information that you need.

Thursday, February 16, 2012

ASP.NET Wizard + Stored Procedure

HI,

I have created a wizard control to collect user informations.

First step : Personal informations

Step Two : Educational informations

After user completed and click finish button I want to add Personal informations to 'Personal' table in my sql server database.

And also Educational information in to 'Educational' table.

Using Stored Procedure (here it is)

CREATE PROCEDURE dbo.StoredProcedure1

@.Fname varchar(10),

@.Lname varchar(10),

@.Email varchar(50),

@.Tel varchar(20)

AS

INSERT INTO Personal (Fname, Lname, Email, Tel)

VALUES (@.Fname, @.Lname, @.Email, @.Tel)

RETURN

So Now I want to add another stored procedure for Educational table.

How do I do this.Should I modify this.

But Educational info should goes to 'Educational' table not to 'Personal'

How do I chieve this.

Thanks

I do not know how much information you have from another step, but you can do everything in one stored procedure call. Just add parameters from your next wizard step and do insert into 2 tables at one shot in one stored procedure with two insert statement. This way you can link this records if you have any relations between your tables.

Thanks