Questions tagged [sqlhelper]

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

Filter by
Sorted by
Tagged with
7 votes
1 answer
20k views

MySQL Error Code: 3948 Loading local data is disabled; this must be enabled on both the client and server sides

I have this code to upload CSV files into MySQL, I tried to upload the CSV files I created, but I keep getting this error when I run the code. The code I'm trying to run is here: Load Data Local ...
Dylan Powell's user avatar
4 votes
1 answer
9k views

Timeout issue when using sql helper(Microsoft.ApplicationBlocks.Data)

I am having timeout issues when dealing with long sql queries, the Dataset which timesout for long queries is : static public DataSet Getxxxx(Guid xxxx) { DataSet ds = SqlHelper.ExecuteDataset(...
Mr A's user avatar
  • 6,568
4 votes
3 answers
11k views

SQLHelper Class

Is there a recent version of the SQLHelper class out there. I've been using one for a few years now and was wondering if there is a new version out there for .NET Framework 2.0 or 3.0. I prefer this ...
Saif Khan's user avatar
  • 18.6k
3 votes
3 answers
2k views

How can i select from table where tablename is specified as SqlParameter?

I am trying to perform dynamic sql select where I am selecting from a table using a parameter. SELECT null FROM @TableName However I am getting error must declare table variable @TableName. I ...
Valamas's user avatar
  • 24.4k
3 votes
2 answers
63 views

SQL: Left Outer join that can switch what columns to join with depending on data inside the column

I'm trying to join these two tables together to show the record in base and the null in history. The problem I am having is with a left outer join. when BO.val2 = 0: I want the join to use BO.VAL5 = ...
Beau Jenkins's user avatar
3 votes
0 answers
440 views

How to manage open and close connections of SqlHelper class

I am managing a code and when i had a code walkthrough i found that in many places SqlHelper class was used and i have a question regarding that. In many places connection.open() and connection.close()...
Anshul Mathur's user avatar
2 votes
3 answers
5k views

Setting CommandTimeout in Microsoft's Data Access Application Block (SQLHelper)

I'm using the Data Access Application Block (SQLHelper) to execute SQL against a database. I have one query which takes longer than the default command timeout of 30 seconds. I want to up the timeout, ...
Mashmagar's user avatar
  • 2,604
2 votes
4 answers
3k views

Lightweight ADO.NET Helper Class

Can anyone point me towards a current library that provides basic wrapping of ADO.NET functionality? I'm looking for something along the lines of the old SqlHelper class and am not really interested ...
DanP's user avatar
  • 6,368
2 votes
2 answers
6k views

Pass object parameter to stored procedure by SqlHelper

I have a SQL table like this: ID is Identity column. And I have a class for this table in ASP.Net project like this: public class Topic { public int ModuleID { get; set; } ...
Ali Soltani's user avatar
  • 9,828
2 votes
2 answers
245 views

Android : Adapter is not working with Arraylist of Hashmap

I am trying to show some data offline from SQLite database. Data is coming fine but I am not able to show that on listview with adapter. libraryList.clear(); libraryList = dBhelper.localQuestionBank(...
Shivam Kannojiya's user avatar
2 votes
2 answers
556 views

Create a Table using SQLHelper with a variable name in C#

I want to create table with name of username.The username is written in uname.Text textbox in xaml. I am using SQLHelper for this.I think I am having a problem with syntax.Can anyone correct my syntax ...
Amaid Niazi's user avatar
2 votes
0 answers
50 views

Modify data in excel using jxl without creating copy

I'm trying to use an excel file as a database and the app constantly needs to read and modify the file. As explained in this Q&A, it is necessary to create a copy of original excel file and all ...
Dante's user avatar
  • 457
2 votes
0 answers
1k views

How to set CommandTimeout in SqlHelper.ExecuteDataSet()?

I have a method which uses SqlHelper.ExecuteDataSet(): Private Function UpdateStatusCode(ByVal no As String, ByVal status As String) As Boolean sqlConn = New SqlConnection(Conn) Dim breturn ...
hendryanw's user avatar
  • 1,879
1 vote
1 answer
17k views

Sql helper class in asp.net

Why should we use sql helper class in our application.What difference between sql helper class and simple class.In which situation sql Helper should used.Please define structure of class.
Vishal Nagra's user avatar
1 vote
3 answers
269 views

How to make value of a column name appear with single apostrophe in sql statement of sql helper inside asp. net

SQLHelper sqhlpr = new SQLHelper(); sqhlpr.SqlText = "Select StudentName from tblStudentInfo where class=" + NurseryButton.Text; DataTable dt = sqhlpr.getDataTable(false); This is my code.Now ...
Pratik.S's user avatar
  • 470
1 vote
1 answer
6k views

Is this way sufficient to execute DataSet?

I query one of my table using Stored Procedure Here is an example of method I have. I would like to make sure it's the most sufficient way and in case of 10000 of requests it will not cause overheat ...
Michael Born's user avatar
1 vote
1 answer
60 views

How to assign a value to the next following column based on logic of preceding values in SQL HIVE?

I am trying to find a way to assign a value to the next following column based on logic of preceding values. For example, lets say we have a table with the column temp. If temp goes above as 95 then ...
leaner007's user avatar
1 vote
1 answer
266 views

Microsft SQLHelper vs Dapper

I am new to C#, programming for less than a year. Until now I have been using the Micrsoft SQLHelper class. (copy of text header below) I recently came across Dapper. Question is, should I switch to ...
Bradley Timm's user avatar
1 vote
1 answer
43 views

Android Pre Populated Database - Adding New Pre Populated Rows After Publication

I'm having trouble with a pre Populated database in android. Not the usual problems though. I've got the database working just fine. My problem comes with adding new data after the app has been ...
xn1's user avatar
  • 417
1 vote
2 answers
409 views

Java/Android SQL Helper Class Why drop the table when upgrading?

For the majority of the examples and tutorials I have seen it is always suggesting to execute SQL to Delete the table if it exists in the onUpgrade method. Why would you want to delete the table as ...
Sambuxc's user avatar
  • 464
1 vote
3 answers
1k views

SqlHelper.ExecuteReader results varying and unexpected when certain number of records are returned

Note: You may not need to read the whole thing to know what's wrong... skip down to the part about the 3 scenarios if you'd like. Only read the begin if you'd like some background info on how I've ...
Matt's user avatar
  • 5,587
1 vote
1 answer
1k views

SqlBulkCopy with SqlHelper class

I've installed DataAccessApplicationBlock.msi and I got the Microsoft.ApplicationBlocks.Data.dll file into my bin folder. I found every other sqlhelper methods except ExecuteBulkCopy. How do I add ...
ACP's user avatar
  • 35.1k
1 vote
3 answers
211 views

Regexp expression from Oracle SQL to Big Query

I previously had help here for an Regexp expression in oracle sql which worked great.However, our place is converting to Big Query and the regexp does not seem to be working anymore. In my tables, i ...
Jonathon Chau's user avatar
1 vote
1 answer
2k views

SQLHelper Class - ExecuteNonQuery Code Modification

I am just browsing the code in the SQLHelper Class V2 and I notice the following public static int ExecuteNonQuery(SqlTransaction transaction, CommandType commandType, string commandText, params ...
Saif Khan's user avatar
  • 18.6k
0 votes
2 answers
59 views

Updates values from column in SQL

Im trying to change the value from the Merchant_Category_Code column. I tried CASE Statement but didn't work. CASE WHEN MERCHANT_CATEGORY_CODE = 6051 THEN 'Quasi Cash–Merchant' WHEN ...
Mr.B's user avatar
  • 3
0 votes
2 answers
6k views

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 ...
Angel Cloudwalker's user avatar
0 votes
1 answer
3k views

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 ...
Pratik.S's user avatar
  • 470
0 votes
2 answers
3k views

What is going on in this ExecuteDataset method?

OK so I one page I find this line: objDsCourse = SqlHelper.ExecuteDataset(ConfigurationManager.ConnectionStrings("connstr").ConnectionString, CommandType.StoredProcedure, "Course_NewReportGet_Get_Sav"...
MetaGuru's user avatar
  • 43.3k
0 votes
1 answer
77 views

Lag Based on Specified Order in SQL

Does anyone know of a way to LAG in a specified order? In the example below, I provide a table with my current output [Lag (Current)] and my desired output [Lag (Desired)] columns. I am interested in ...
leaner007's user avatar
0 votes
1 answer
1k views

SQL world table, need help to show continents with more than 10 countries

I am trying to learn sql and i have downloaded a world database. My problem is that i cannot find out how to pick the continents with more than 10 countries in them My database is: name: (alle ...
oljo's user avatar
  • 59
0 votes
2 answers
549 views

Return a 0 if no rows are found in Microsoft SQL Server

I need your help with this query. My table CSO_EMP_ORG_DPM_VIE has a column with different keys. Column name is EXT_KEY. When I receive the same key number in EXT_KEY, I want the SQL code to count the ...
Henk Hadders's user avatar
0 votes
1 answer
459 views

Query Help to determine average price for products < 3

Hi I've been working on this query, and I can't quite figure out the where statement to show only the average price of products < 3 "List each Product Class, number of items in the class and the ...
James Brown's user avatar
0 votes
1 answer
1k views

how to access an Output parameter in the old SQLHelper.cs class?

i'm currently modifying a legacy application that uses the SqlHelper class in c#. how do you access the OUTPUT value using an executedatareader?
Martin Ongtangco's user avatar
0 votes
0 answers
4 views

SQL Stored Procedure adding values to table run successful, but no result show in the table

I have created a stored procedure in SQL Server to add new student record to Student table. I have grant permission to one of the roles I created that is "DBAdmins". I have also login as &...
Jason Low's user avatar
0 votes
0 answers
36 views

System.IndexOutOfRangeException mysteriously thrown from System.Collections.Generic.List.Add(T item)

I have been struggling to figure out the cause of an exception with the following stack trace (deliberately shortened): System.IndexOutOfRangeException: Index was outside the bounds of the array. ...
Borislav-K's user avatar
0 votes
1 answer
61 views

Count Unique Values Throughout One Day For Nonconsecutive Student ID's

I am trying to figure out how to count all instances where a student is online without counting duplicate instances. For example, in the screenshot below, I want to see a column counting only ...
leaner007's user avatar
0 votes
3 answers
113 views

Based on todays date, how to get the date of the penultimate working day?

I try to figure out, how I can get the penultimate workingday from todays date. In my query, I would like to add an where clause where a specific date is <= today´s date minus 2 working days. Like: ...
Frederik Ceglarek's user avatar
0 votes
1 answer
454 views

SQLHelper.DB not passing parameters to stored procedure

This is a new issue of my previous question (C# Using Parameters in SqlHelper.DB). If I pass null as the parameters and set the command text to a parameterless stored procedure, it works fine. ...
Jeremy Hodge's user avatar
0 votes
0 answers
690 views

C# Using Parameters in SqlHelper.DB

I installed SqlHelper.DB NuGet package (https://www.nuget.org/packages/SQLHelper.DB/) and I am having issues passing parameters to the AddQuery method. I am passing a List of SqlParameter to my ...
Jeremy Hodge's user avatar
0 votes
1 answer
163 views

SQL tool to list the related tables to the parent table

Dears, Could you please help me to find a SQL tool that will show me the list of the tables that have relation with the parent table. Example: Select * from table_1 when I write join there will ...
Mylinda's user avatar
0 votes
1 answer
2k views

Select Into ##TempTable from C# DataTable

I have a DataTable varriable in C# and I want to insert it to a ##TempTable in SQL Directly. I dont want to do like insert into ##TempTable row by row. How can I do that ? Select Into ##TempTable ...
Ali CAKIL's user avatar
  • 405
0 votes
0 answers
417 views

How to use Sqldependency with SqlHelper class

I am used to working with the SqlHelper class and so would like to modify the existing code to make use of it. existing code public string GetData() { string message = string.Empty; string ...
sukesh's user avatar
  • 2,443
0 votes
0 answers
274 views

sql helper class get module for the procedures that return multiple values

I've written a module in my sql helper class which returns DataSet from the stored procedure. // public class SqlHelper public DataSet ExecuteDataSet(string commandText, SqlParameter[] sqlParameter)...
user4221591's user avatar
  • 2,100
0 votes
0 answers
146 views

How to avoid duplicated sql connection code

So, I recently asked a question about a class called SQLHelper, that was designed to cut down duplicated code whenever you connect to a SQL server, create a stored procedure command, etc. Essentially,...
Soni's user avatar
  • 19
0 votes
1 answer
1k views

Can't Import libraries for SQLhelper class

I'm trying to remove duplicate code to connect to SQL database, create stored procedure parameters, etc. I found that SQLHelper class requires Enterprise library. So as we use NuGet, I downloaded ...
Soni's user avatar
  • 19
0 votes
2 answers
2k views

SqlHelper ExecuteDataSet with named parameters?

Currently I'm using SqlHelper.ExecuteDataSet(string storedProcedure, Object[] parameters); to retrieve data from the database. The issue resides in the fact that order matters. I recently abstracted ...
Shelby115's user avatar
  • 2,837
0 votes
0 answers
2k views

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 ...
renakre's user avatar
  • 8,221
0 votes
2 answers
1k views

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 ...
vini's user avatar
  • 4,703
0 votes
1 answer
3k views

DataAccessLayer.SqlHelper.Stored procedures. Output parameters

I have a database with stored procedure inside. I'm trying to execute procedure using SqlHelper. However I'm getting weird error. public override User Insert(User entity) { var param = ...
magic987's user avatar
0 votes
1 answer
862 views

Singleton Data Access Object (Dao) & SQL Helper Instance, Is here any Performance drawback?

I need comments from Experts. I write my own SQL Helper Class to Communicate with DB. Why I use it as because I try to Encapsulate the Ado.Net logic. Try to set a common standard for my developer ...
Shubhajyoti Ghosh's user avatar