Questions tagged [sqlparameter]

a .NET class for representing SQL parameters in SqlCommands

SqlParameter is a noninheritable .NET class in the System.Data.SqlClient namespace whose instances represent a parameter for a SqlCommand.

319 questions
-1
votes
1 answer

The SqlParameter is already contained by another SqlParameterCollection.3

This is my first question: The SqlParameter is already contained by another SqlParameterCollection. SqlDataReader rdr[0] vs. object brings me table columns values. public ArrayList[] GetInfo(string sqlCommand, SqlParameter sqlParameter) …
hikmet_anil
  • 89
  • 3
  • 14
-1
votes
1 answer

No Value given for one or more required parameters in registration form

this is a follow up from my last quistion (Whenever i try to run this code it gives me an error. [Asp.net SQL]) So I did what you told me and added parameters, but now i get a diffrent error. (it works without the parameters, but i cant insert '@'…
Shaked Dahan
  • 402
  • 5
  • 22
-1
votes
1 answer

Using if statements when inserting data in multiple tables with one-to-one relationships

I'm still new to programming and I was given the task of making a database application for the members of our organization using VB.NET and SQL Server. I have 3 tables: Person, Telephone and Employment. Person has the primary key that I set to…
Irond64dpool
  • 27
  • 2
  • 9
-1
votes
3 answers

SQL Combine two statements from old tabels into a new one

I want to create a new table in a stored procedure. In the new table I need a row with a combined value from the old tables. It should look like sees Table_old1 Table_old2 Table_new ---------------------------------------- Edward …
-1
votes
2 answers

Get values from jscript datepicker in form

I'm trying to use a jscript Datepicker UI calendar when I try to pass the text properties to an sqlparameter in asp.net .cs code. behind I can see the cldStartProj text box object but I can't see the cldEstProjEnd or cldEndProj textboxes. I am…
Marcus72
  • 99
  • 3
  • 14
-1
votes
2 answers

SqlCommand parameters are not substituting correctly

private SqlCommand createSQLQuery(SqlCommand command) { string[] allTheseWords; if (textBoxAllTheseWords.Text.Length > 0) { allTheseWords = textBoxAllTheseWords.Text.Split(' '); string SQLQuery = "SELECT distinct…
Cocoa Dev
  • 9,361
  • 31
  • 109
  • 177
-1
votes
1 answer

an SQL Search query using more than one condition

my problem is that , i made a child form for searching , but i have problem in sql query and parameters , my code is SqlConnection sc = new SqlConnection( "Data Source=MOHAMMED-PC;Initial Catalog=salessystem;Integrated…
Mohammed AL Jakry
  • 69
  • 1
  • 5
  • 21
-2
votes
1 answer

insert into sqlserver with sqlParameters in c#

void BtnConfirmClick(object sender, EventArgs e) { string first = txtFname.Text; string last = txtLname.Text; string query = "INSERT INTO customer (first, last)"; query += " VALUES (@fstName,@lstName)"; string url =…
Toni
  • 5
  • 2
  • 4
-2
votes
1 answer

Parameter does not take effect for sql command

I am trying to use parameters for my project but somehow it does not return an output. Please see my code below. SqlCommand zSqlComm = new SqlCommand("SELECT * FROM tblAppUsers WHERE Username = @Username AND PasswordHash = HASHBYTES('SHA2_512',…
-2
votes
3 answers

Use string of numbers as SqlParameter to SQL query resource with IN Operator

I am trying to pass a string p_strIds with number values separated by ",": 2844099,2844100,2844101,2844102,2844103,2844104,2844105,2844106,2844107,2844108,2844109,2844110,2844111,2844112,2844113,2844114,2844115,2844116,2844117,2844118 The string is…
Rarm
  • 101
  • 1
  • 2
  • 9
-2
votes
3 answers

Dynamic where clause in parameter

I am currently trying to build up the where clause of an SqlCommand. something similar to this myCommand.CommandText = "SELECT * " + "FROM TABLE1 " + "@whereClause"; //I build up the where clause with…
Rémi
  • 3,867
  • 5
  • 28
  • 44
-2
votes
2 answers

Column Combination parameter

Why I got error with this? Or is it possible to have a query like this? select Employee.EmployeeID, Employee.LastName + ', ' + Employee.FirstName + ' ' + Employee.MiddleName as EmployeeFullName From Employee Where EmployeeFullName = 'someFullName'…
Karlx Swanovski
  • 2,869
  • 9
  • 34
  • 67
-2
votes
2 answers

Why a SqlParameter does not get value?

I am trying to initialize the value of a SqlParameter with a string. but why does it not get the value ? This is what I tried: int loadChart(string status) { connect(); SqlParameter[] parameters ={ …
Md. Arafat Al Mahmud
  • 3,124
  • 5
  • 35
  • 66
-3
votes
1 answer

How to store SqlParameter in a Hashtable

How do I store a SqlParameter in a Hashtable? I'm trying to put P in param on my example below. Hashtable param = new Hashtable(); SqlParameter P = new SqlParameter("@Picture", SqlDbType.Varbinary, b.Length, ParameterDirection.Input, false, 0, 0,…
-3
votes
1 answer

Table as parameter in SQL Server

I have the following stored procedure: ALTER procedure [dbo].[jk_insertAllLocation] @locationTbl as locationTable readonly, @TableName varchar(100) as declare @tbl as locationTable, @sql nvarchar(max) begin set @sql =…
User7291
  • 1,095
  • 3
  • 29
  • 71
1 2 3
21
22