Showing posts with label desperatly. Show all posts
Showing posts with label desperatly. Show all posts

Wednesday, March 7, 2012

Desperatly Need Help with MSDE installation and Config

Hi all, I know read all the posts already up on this subject... Hear me out.

Can anyone give an easy to understand, and I mean easy method for installing MSDE and configuring it so that I can connect to my server using Visual Studio.NET C#. I am having no end of troubles and I don't really understand why. I can log into osql using

osql -S BIGJ -E

that gets me to

1>

No problems so far

but when I try to connect using

SqlConnection("Server=BIGJ;DataBase=registeredUsers;Integrated Security=SSPI");

I am having no luck and I don't really understand why

Here is the stack trace

[SqlException: Login failed for user 'BIGJ\ASPNET'.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
ADOAccess.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\adoaccess\webform1.aspx.cs:52
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()

I think I am not understanding the fundamentals of SQL server or something so if anyone can help or point me to a good tutorial that will help me not only solve my problem but also understand what is going onas well.

Thanks everyone

Hi

You must add the user "MACHINENAME\ASPNET" in your case "BIGJ\ASPNET" to every db you run in your PC (localhost), that way .net can log on the db.

To do that (and much more) you can use this free tool:

http://forums.asp.net/631069/ShowPost.aspx

Regards

|||

Thanks for the tip, I have SqlWDA installed but when I try and login it just hangs, I try using Windows integrated option and the SQL Login Option no luck just a frozen webpage.

Can you explain this, when I make a SqlConnection using Visual Studio dialog and press tesst connection it passes, if I copy that connection string into code I get the error I explained above? I'm really stuck

|||

/* Give ASPNET User login rights to the server database */

if not exists (select * from master.dbo.syslogins where loginname = N'MACHINE_NAME\ASPNET')
exec sp_grantlogin N'MACHINE_NAME\ASPNET'
exec sp_defaultdb N'MACHINE_NAME\ASPNET', N'DataBase'
exec sp_defaultlanguage N'MACHINE_NAME\ASPNET', N'us_english'
GO

/* Give ASPNET User Access to database */
use [DataBase]
GO

if not exists (select * from dbo.sysusers where name = N'ASPNET' and uid < 16382)
EXEC sp_grantdbaccess N'MACHINE_NAME\ASPNET', N'ASPNET'
GO

/* Regards */

Desperatly need help to import .csv file using Bulk Insert

Hi all-

I am in need of some help importing a .CSV file into a SQL Server 2005 Enterprise Edition.

The problem is I already implemented Bulk Insert task in SSIS but it is not importing any data. My detailed layout is as follows :
In SSIS package1 -
In Control Flow Bulk Insert Task has been inserted
Properties of Bulk Insert Task:
Connection adtc009d.ganny
Destination Table ganny.dbo.t4
Format
Format Specify
Row Delimiter {CR}
Column Delimiter Comma{,}
Source Connection
File r.csv
Options
Options Check Constraints
Maxerrors 20

This bulk insert task is connected to Data flow task, if we click edit to data flow task, data flow section will come, here Flat file source & OLE DB Destination is there. Flat file source is connected to OLE DB Destination.

Properties of Flat File
Connection Manager
Flat file connection Manager
here by clicking new link flat file properties to this.
Preview
by clicking preview all data are visible
Properties of OLE DB Destination editor
Oledb connection manager adtc009d.ganny
Data access mode: Table or View - fast load
Name of Table or view dbo.t4

After designing all this then if I start debugging I could able to get records are imported to a table.
Please suggest me where I am going wrong.

Thanks in advance
Karna

Karna,

There are several ways to find out what's wrong, the easiest is

looking at the errors reported by SSIS when you run the package.

The other way is to look at the file source and preview the rows to see if your Column delimiters and row delimiters are working correctly.

Try these and let me know

|||On the flat connection manager, you might need to put a text qualifier (like "). Also you might want to try {CR}{LF} on the row delimeter.|||Dear all,

Thanks for reply.

I solved this problem by using only Bulk Insert option alone, without using data flow task.

My biggest problem is whether we have any tool to check validations before inserting records to a table. It has to check duplicates, if duplicates are existing just insert only only real records not the duplicate ones.

I tried removing redundancy by inserting all records from csv data file to a table called t1, create another table which is copy of table t1 but has primary key called table as t2. Use insert into t2 by selecting only distinct records from t1.

My question apart from above option whether we have any tool which does all related job in SSIS.

Thanks in advance
Karna|||

The short answer is No.

The best option is to import into a 'staging' table. then you can have as many 'clean-up' and data modification steps as is necessary. For example, you may wish to create a output (in some form) of the rows that fail the concurrency test.