Questions tagged [sqlhelper]

SqlHelper class is a utility class that can be used to execute commands in a SQL Server database.

Introduction
The SqlHelper class is a utility class that can be used to execute commands in a SQL Server database. We know ADO.Net methods like SqlConnection,SqlDatAdapter and SqlCommand. To use these methods users typically write repititive lines of code like connecting to a db, executing the queries and finally disconnection from the db, etc. SqlHelper Class helps to reduce the number of lines coded.

Namespace
Microsoft.ApplicationBlocks.Data

Methods
ExecuteDataSet
ExecuteNonQuery
ExecuteReader
ExecuteScalar
ExecuteXmlReader

Syntax
SqlHelper.ExecuteDataSet(SqlConnection connection,string spname,params object[] parameter)

Example

SqlHelper.ExecuteNonQuery(DataAccess.ConnectionString, CommandType.StoredProcedure, "InsertStudent", new SqlParameter ("@RollNo",rollNo), new SqlParameter("@Name",name),new SqlParameter ("@Class",class));

References
http://msdn.microsoft.com/en-us/library/cc467894.aspx
http://www.codeproject.com/Tips/555870/SQL-Helper-Class-Microsoft-NET-Utility

50 questions
0
votes
0 answers

sqlhelper - connections never closed

I have been using sqlhelper class, but I got problem after the number of user activities in the system increased. The hosting company mentioned that the site has been generating a heavy load on the server's CPU. It appears that a high number of…
renakre
  • 8,001
  • 5
  • 46
  • 99
0
votes
2 answers

Where DLL file should be place in .NET web application

In a C# ASP.NET Web Application I'm structuring it with the web application on the top, and then multiple projects for handling business layers and a data access layer. I have a DLL file that contains SQL Helper. Should that be placed in the bin of…
Angel Cloudwalker
  • 2,015
  • 5
  • 32
  • 54
0
votes
2 answers

Not able to establish connection via SqlHelper class

string strCon = ConfigurationManager.ConnectionStrings["constr"].ConnectionString; Company.Common.SqlHelper.Connect = strCon; Getting this exception someone please help "The type initializer for 'Company.Common.SqlHelper'…
vini
  • 4,657
  • 24
  • 82
  • 170
0
votes
1 answer

Confusion of sql helper class

I want to display list of names and roll no of students who are studying in nursery stored in my database......But there seems to be an error in following code which i can't figure out protected void NurseryButton_Click(object sender, EventArgs…
Pratik.S
  • 470
  • 10
  • 30
-1
votes
2 answers

May I use SqlHelper Class in VB.NET if Oracle is the database?

I am using SqlHelper in my application. It's working properly if using SQL Server as the database. But it's not working in Oracle. It shows: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The…
Sesuraj
  • 7
  • 1
  • 8
1 2 3
4