Showing posts with label users. Show all posts
Showing posts with label users. Show all posts

Wednesday, March 28, 2012

importing users into membership database

Hi, i have a new site built in .net using the login/membership system. i have a legacy database (access) of users from the previous site with email, name, password, etc.

Is it possible to import this data straight into my new membership tables through some insert statement, software or through some other way?

You can do it in code. Use the method CreateUser.

That is: Membership.CreateUser(...

Importing users from SQL to NDS LDIF

hi all,
i'm trying to figure out how to import users from SQL table to netscape directory server (if it's even possible). i know you can do it by using third party tools like ldifde to import from SQL to AD, but i don't think it will wrok for SQL to NDS....

can anyone please help??

thanks
AlexDo you have the import specifications for ldif ? If so, you should be able to export the sql server data in that format.|||Originally posted by rnealejr
Do you have the import specifications for ldif ? If so, you should be able to export the sql server data in that format.

I do have specifications for LDIF, but i'm still unsure how to export SQL data in that format... would you please give me some more info?

Thanks much!

Alex

Importing text files to Sql Server using Asp.net/Vb.net

Hi,
Can anyone help? Need to upload a text file to a sql database but keep getting errors.
I'm creating a page that will allow users to to bulk import and update to a MsSql database. The users provide a text file every so often with new/update information. So i want to use a DTS package to transform the infomation, and create a table in the database, then check against existing/non existing records, if the record exist, update it, if not insert it. I'm using Visual Studio.Net, ASP.Net and coding in VB.Net.

Anyone know where i can find documentation/code regarding the above?
I will be greatful for any help.Hi There,

I looked into using DTS packages to upload data from a spreadsheet about a year and a half ago, but decided against it due to the various problems associated. I opted for the calling of a stored procedure with a bulk insert statement to load the information from a CSV file. Here is c# code for the calling of a DTS package that was used, should be easy enough to convert to vb.net.
BTW you are using DTS; (add a reference to Interop.DTS, i think it is Microsoft DTSPackage Object Library)

All the best, John

string serverName = System.Configuration.ConfigurationSettings.AppSettings.Get("ServerName");
string serverPassword = System.Configuration.ConfigurationSettings.AppSettings.Get("ServerPassword");
string userName = System.Configuration.ConfigurationSettings.AppSettings.Get("UserName");

bool bSuccessful = true;
int pErrorCode;
int lHelpContext;
string sHelpFile;
string sInterfaceError;
string sErrSource;
string sErrDescription;

int DTSStepExecResult_Failure = 1;

Package2Class dtsPackage = new Package2Class();

object varPersistStgOfHost = null;

dtsPackage.LoadFromSQLServer(serverName, userName, serverPassword, DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, null, null, null, DTSPackages.PackageName, ref varPersistStgOfHost);
dtsPackage.Execute();
// Check each step for failure
for (int stepCount=1; stepCount <= dtsPackage.Steps.Count; stepCount++)
{
if ((int)dtsPackage.Steps.Item(stepCount).ExecutionResult == DTSStepExecResult_Failure)
{

dtsPackage.Steps.Item(stepCount).GetExecutionErrorInfo(out pErrorCode, out sErrSource, out sErrDescription, out sHelpFile, out lHelpContext, out sInterfaceError);

bSuccessful = false;
}
}
dtsPackage.UnInitialize();|||hi John,

Thanks for the help, i do appreciate it! will try the code and see if i have any luck!
take care..

jen|||I do not see any part in the code that references the csv file.|||As the above code calls a DTS package that in turn loads the CSV file.

Friday, March 23, 2012

Importing old data into asp_tables...?

I have created an application that uses the login, create, etc login components in .net. How hard is it to convert all my old users, passwords, usertypes into the new tables. It almost looks like I have to do them by hand and created a new guid(userid), along with the same guid in the aspnet_usersinroles and aspnet_Membership. Is there a script to do this programatically?

Hi,

You can use t-sql cursor to go record by record thru your old table and inserting to asp.net tables. The difficult part is passwords. I think it would be too difficult to decode and encode password in t-sql.

So, probably first import data and then use asp.net to re-encode passwords. As far as I know there are no utilities to do it automatically.

Monday, March 19, 2012

Importing Excel "Reports"

I'm trying to import data which from Excel which has been "prettied up" to make it readable to users. The report has a fixed number of columns and the data itself is well structured, but there are blank lines etc.

The problem I'm having is unless the first row of the spreadsheet contains or headers, SSIS fails with error "External table is not in the expected format." and the exception below is thrown.

So I thought I'd be clever and create a template spreadsheet with the same number of columns and set the first row to strings - I made all columns DT_WSTR thinking I could extract the numeric and datetime data from the actual rows which contain data and convert using a script. But SSIS simply ignores the numeric values from the spreadsheet - all I get is String or Date values and nulls for all numeric cells?

Dave

Error at Monthly Balance [Connection manager "Excel Connection Manager"]: An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft JET Database Engine" Hresult: 0x80004005 Description: "External table is not in the expected format.".

Error at Data Flow Task [Excel Source [1]]: The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.

Dave,

You may find the DataDefractor SSIS Data Flow Source useful. It's main purpose is to allow you to extract factual and contextual information from human-readable reports and then flow this data into the SSIS pipeline. You can download a free beta at http://www.datadefractor.com.

Cheers,
Vassil

|||Thanks Vassil, Looks like a useful component.