[Solved] List of stored procedures inside a database

The following query will list all user defined stored procs (including their parameters and parameter types) in your default database: SELECT sp.name, p.name AS Parameter, t.name AS [Type] FROM sys.procedures sp LEFT JOIN sys.parameters p ON sp.object_id = p.object_id LEFT JOIN sys.types t ON p.system_type_id = t.system_type_id WHERE is_ms_shipped = 0 ORDER BY sp.name Put … Read more

[Solved] Failed to convert parameter value from a SqlParameter to a String

The ExecuteDataSet call takes the actual parameter values, not SqlParameter objects. Change it to simply do: var ds1 = db.ExecuteDataSet(“Getmagesbylot2”, “Bob123457”); You might also want to check that you’ve spelled the SP correctly, maybe it should be GetImagesByLot2. 2 solved Failed to convert parameter value from a SqlParameter to a String

[Solved] Stored procedure has too many arguments in SQL Server and C# but on second entry

I think you didn’t clear the parameters. You should clear it always after your transaction. cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue(“@UserId”, userId); cmd.Parameters.AddWithValue(“@MonthlyIncomeName”, income.MonthIncomeName); cmd.Parameters.AddWithValue(“@MonthlyIncomeAmount”, income.MonthIncomeAmount); cmd.Parameters.AddWithValue(“@TotalMonthlyIncome”, income.MonthIncomeAmount); cmd.Parameters.AddWithValue(“@Month”, insertMonth); cmd.Parameters.AddWithValue(“@Year”, insertYear); cmd.ExecuteNonQuery(); cmd.Parameters.Clear(); // insert this line And search about AddWithValue vs Add like @cha said that check your parameter types. See this. 1 solved Stored … Read more

[Solved] How to add values from a string in SQL Server 2008 using a stored procedure? [closed]

I have prepared a SQL script for you which splits the input string twice then converts is into row data, and finally inserts into a database table To split string data, I used this SQL split string function First of all, you need to create this function on your database. Unfortunately, if you do not … Read more

[Solved] stored procedures instead of forms

You’re describing Web Forms, which is another part of ASP.NET, but not part of ASP.NET MVC. The calling of stored procedures has nothing to do with any of these technologies. Some people choose to put such calls in their Controller or Code-Behind rather than having it in a separate data layer. 2 solved stored procedures … Read more