I get an error Procedure or function “myStoreProcNameHere” has too many arguments specified. Below is my stored procedure and SqlDataSource. I’m using a GridView to edit data. Help? 🙁 Stored procedure: ALTER PROCEDURE UpdateTwoTables (@ID int, @UserID varchar(10), @Pass varchar(50), @Enabled int, @Permission int, @Rank int, @FName varchar(50), @LName varchar(50), @Phone varchar(50), @Email1 varchar(50), @Email2 […]
Does anyone know how to convert a DATETIME COLUMN to TICKS in SQL Server?
I am trying to get authentication and authorization working with my ASP MVC project. I’ve run the aspnet_regsql.exe tool without any problem and see the aspnetdb database on my server (using the Management Studio tool). my connection string in my web.config is: <connectionStrings> <add name=”ApplicationServices” connectionString=”data source=MYSERVERNAME;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true” providerName=”System.Data.SqlClient” /> </connectionStrings> The error I […]
I have an SQL query similar to the following: create procedure test ( @param1 nvarchar(max) ) as begin select * from table where column1 in (@param1) end Now I need to pass the value of @param1 from my .net application in such a way that the above query works. Can some one please advise me […]
Hi I’m getting the error You do not have permission to use the bulk load statement. when I try to execute a stored procedure. I’ve seen some websites mentioning about the bulkadmin role, but I don’t see it. I’m using SQL Server 2008. Any ideas?
I’m using PBKDF2 in my application to store users passwords. In my Users table, I have a Salt and Password column which is determined like this: // Hash the users password using PBKDF2 var DeriveBytes = new Rfc2898DeriveBytes(_Password, 20); byte _Salt = DeriveBytes.Salt; byte _Key = DeriveBytes.GetBytes(20); // _Key is put into the Password column […]
I have been trying to add a column programmatically in ASP.NET to modify the tables in SQL Server. Please see the following code: string suppliernotxt = supplieridlist.ToString(); //SqlCommand cmd2 = new SqlCommand(“ALTER TABLE [ProductNormalDB] ADD suppliernotxt nvarchar(20) NULL”, con); SqlCommand cmd2 = new SqlCommand(“ALTER TABLE ProductNormalDB ADD @supplierlist nvarchar(20) NULL”, con); cmd2.Parameters.AddWithValue(“@supplierlist”, suppliernotxt); //cmd2.Parameters.AddWithValue(“@supplierlist”, suppliernotxt.ToString()); […]
I have an asp.net app that uses Linq to SQL. One query from the app was timing out (over 30 seconds to execute). I increased the CommandTimeout of the DataContext, and it did complete in 45 seconds. I copied the Linq to SQL generated SQL from SQL Profiler to SSMS and executed it using the […]
I have googled this a little and didn’t really find the answer I needed. I am working on a webpage in C# with SQL Server and LINQ for a customer. I want the users to be able to send messages to each other. So what I do is that I unit test this with data […]
I have a general question on whether something can be done – and whether it will be the most efficient way of doing it ! To summarise: can I pass an object collection as a parameter to a stored procedure? Let’s say that I have a SQL Server table called Users [UserID, Forename, Surname] and […]