Tag: asp.net

SQL Server UDF SQLCLR Call Converts Characters Into Question Marks

I’ve found nothing on Google or SO that quites lines up with my issue. In SQL Server, I have a scalar function (we’ll call it dbo.MySqlStringFunction). What this function does is call a utility written in C# that calls an ASP.Net view and returns the HTML as a SqlString. The function definition in SQL Server […]

Procedure or function 'stored_pr' expects parameter '@name', which was not supplied

I try to make a simpe app with asp and I have a problem. Procedure or function ‘stored_pr’ expects parameter ‘@name’, which was not supplied. My Stored Procedure: ALTER proc [dbo].[spq] @name nvarchar(max) as insert into tableq (name) Values (@name) GO My code in ASP: using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; […]

How to check a value in dataset is empty or not?

I have a fileupload option in my project. It inclueds a query which returns a dataset. It works fine. But now i want to check whether the returning dataset is is empty or the same value i passed as a parameter to the query. Here is my back end code. .cs code if ((FileUpload1.HasFile))//&& (ext […]

Insert data into columns of Excel sheet from SQL Server table

I have an Excel sheet with seven columns and two of those columns are empty. I have the parent table in SQL Server with several columns and complete data. How can I fill these two empty columns by taking data from SQL Server table in ASP.NET MVC? Thanks in advance!

converting from string to decimal eliminates spl characters in c#

Below is my code that is used to read the open office spreadsheet data and insert into database i have three columns that are of type string and four columns that are of type decimals so i am converting them to decimals from fourth column using below code //newly added if (iCol > 2) { […]

SQL query won't show all records if bot critera is null or ''

I created an ASP.NET webpage with C# and SQL Server 2014. I have a GridView1 with a SqlDataSource that has a SELECT query with 2 criteria in controls on the web page. Both are DropDownLists with Decimal(18,0) values. I would like set a WHERE clause so that gridview will return: All records if both criteria […]

Warning: An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll.

enter image description here I am having exception on my this line “SA.Fill(DS, “EmployeeDetails”);”. Its saying that its an Sql unhandled code. This table exist in my db and working perfectly. Below is the preview of my DB. enter image description here If anyone can please help me, it would be appreciated.

While calling SQL CLR procedure getting application pool size reached to Max getting error

While running asp.net application which is calling stored procedure hosted in sql server with sql clr returning below error:- An error occurred: A .NET Framework error occurred during execution of user-defined routine or aggregate “Procedure Name”: System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred […]

Make Procedure with SCOPE_IDENTITY()

I got this three tables CREATE TABLE ( FirstTableId Int primary key identity, Something nvarchar(20) ) CREATE TABLE SecondTable ( SecondTableId Int primary key identity, Something nvarchar(20) ) CREATE TABLE Relation ( RelationId int primary key identity, RelationSomething nvarchar(20), FirstTableId Int, SecondTableId Int, FOREIGN KEY (FirstTableId) REFERENCES FirstTable(FirstTableId), FOREIGN KEY (SecondTableId) REFERENCES SecondTable(SecondTableId), ) I […]

How to get value of DataTable Row in C# asp.net

i am learning asp.net with c# by myself, and i have a problem with DataRows, in db i have users table and there is isadmin column which value is int, i want to redirect users to different page and admins to admin page, but the problem is all users redirects to admin page. Here is […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.