Showing posts with label stuff. Show all posts
Showing posts with label stuff. Show all posts

Wednesday, March 28, 2012

Login failed for user COLDFIRE/ASPNET

i have my SQL server in windows integrated security so my connection string doesnt have to have password and uid stuff.
this is my connection string

data source=COLDFIRE;initial catalog=Northwind;integrated security=SSPI;persist security info=True;workstation id=COLDFIRE;packet size=4096

i tried this in windows form project of .net and work fine, i connected easily but when i tried it in asp project i got this error :

Login failed for user COLDFIRE/ASPNET

whats wrong with it?That's because the ASPNet user account, which was created when you installed ASP.Net, is not set up as a user on the SQL Server.

Friday, February 24, 2012

logging who did what

I have a web application accessing a SQL Server database (the ususal stuff).

I want to be able to log who did what on which table. I need to display this information on the web application. Is there an easy way of doing this, rather that making duplicates of a lot of data?

The best way I have thought of so far is making a new table with the following fields:
Table_Changed
Table_Primary_Key
Old_Field_Value
New_Field_Value
User
Date_Changed

Every time someone changes something, it is logged in this table, so that, at any time, I can display who changed what.
I have one more question. If I do do it this way, is there a way of getting the primary key value of any table? E.G. could I do something like this_table.primary_key.value ?

JagsYou may try to use "Trigger" to do this.|||Thank you for the help, but I am not actually worried about how I am going to do it (I was thinking of using triggers anyway).
I am more worried about whether the method I am using will work nicely, or will the table I create become so large that it will slow the server down too much.|||I guess how large the table gets will depend on how many updates your site will do each day. One option to get around this is to archive the data at set intervals. For instance, setup a sql server job once a month to copy all the data from the production server's logging table onto a 2nd servers logging table. This table would reside on a server that doesn't matter as much how fast it is running as the backup would happen in the middle of the night or some other time of inactivity.