i have multiple checkboxes on my form.i am trying to add them with stored procedure but it gives me Procedure or function konut_ekle has too many arguments specified -
protected void Button1_Click1(object sender, EventArgs e)
-
{
-
-
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString);
-
SqlCommand cmd;
-
con.Open();
-
string cmdstr = "konut_ekle";
-
cmd = new SqlCommand(cmdstr, con);
-
cmd.CommandType = CommandType.StoredProcedure;
-
cmd.Parameters.AddWithValue("@kategori", TextBox1.Text);
-
cmd.Parameters.AddWithValue("@tip", TextBox2.Text);
-
cmd.Parameters.AddWithValue("@il", TextBox3.Text);
-
cmd.Parameters.AddWithValue("@ilce", TextBox4.Text);
-
cmd.Parameters.AddWithValue("@semt", TextBox5.Text);
-
cmd.Parameters.AddWithValue("@fiyat", TextBox7.Text);
-
for (int i = 0; i < CheckBoxList1.Items.Count; i++)
-
{
-
if (CheckBoxList1.Items[i].Selected)
-
{
-
cmd.Parameters.AddWithValue("@ozellik", CheckBoxList1.Items[i].Value);
-
}
-
}
-
cmd.ExecuteNonQuery();
-
cmd.Dispose();
-
con.Close();
-
}protected void Button1_Click1(object sender, EventArgs e)
-
{
-
-
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString);
-
SqlCommand cmd;
-
con.Open();
-
string cmdstr = "konut_ekle";
-
cmd = new SqlCommand(cmdstr, con);
-
cmd.CommandType = CommandType.StoredProcedure;
-
cmd.Parameters.AddWithValue("@kategori", TextBox1.Text);
-
cmd.Parameters.AddWithValue("@tip", TextBox2.Text);
-
cmd.Parameters.AddWithValue("@il", TextBox3.Text);
-
cmd.Parameters.AddWithValue("@ilce", TextBox4.Text);
-
cmd.Parameters.AddWithValue("@semt", TextBox5.Text);
-
cmd.Parameters.AddWithValue("@fiyat", TextBox7.Text);
-
for (int i = 0; i < CheckBoxList1.Items.Count; i++)
-
{
-
if (CheckBoxList1.Items[i].Selected)
-
{
-
cmd.Parameters.AddWithValue("@ozellik", CheckBoxList1.Items[i].Value);
-
}
-
}
-
cmd.ExecuteNonQuery();
-
cmd.Dispose();
-
con.Close();
-
}
-
-
-
-
ALTER PROCEDURE konut_ekle
-
@kategori varchar(50),
-
@tip varchar(50),
-
@il varchar(50),
-
@ilce varchar(50),
-
@semt varchar(50),
-
@fiyat varchar(50),
-
@ozellik varchar(50)
-
AS
-
-
-
SET NOCOUNT ON
-
-
-
-
insert into ilan (kategori,tip,il,ilce,semt)
-
values (@kategori,@tip,@il,@ilce,@semt)
-
-
declare @ilanid varchar(50)
-
-
set @ilanid = scope_identity()
-
-
insert into konut(ilanid,fiyat) values (@ilanid,@fiyat)
-
-
insert into ozellikler(ilanid,ozellik) values (@ilanid,@ozellik)
-
-
RETURNALTER PROCEDURE konut_ekle
-
@kategori varchar(50),
-
@tip varchar(50),
-
@il varchar(50),
-
@ilce varchar(50),
-
@semt varchar(50),
-
@fiyat varchar(50),
-
@ozellik varchar(50)
-
AS
-
-
-
SET NOCOUNT ON
-
-
-
-
insert into ilan (kategori,tip,il,ilce,semt)
-
values (@kategori,@tip,@il,@ilce,@semt)
-
-
declare @ilanid varchar(50)
-
-
set @ilanid = scope_identity()
-
-
insert into konut(ilanid,fiyat) values (@ilanid,@fiyat)
-
-
insert into ozellikler(ilanid,ozellik) values (@ilanid,@ozellik)
-
-
RETURN
-
1 7106
You are trying to add multiple parameters with the same name. Pretty sure you cannot do that.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Penn Markham |
last post by:
Hello all,
I am writing a script where I need to use the system() function to call
htpasswd. I can do this just fine on the command line...works great
(see attached file, test.php). When my...
|
by: Justin |
last post by:
I am trying to do a simple update of a database using a stored procedure. I
have get the following error when executing the code:
"Procedure or function UpdateDetails has too many arguments...
|
by: Child |
last post by:
Hi, I am getting the error: "Procedure or function spAddActivity has too
many arguments specified. " on a stored procedure insert. I compared the
number of parameters in the function and the SP...
|
by: M K |
last post by:
Heres my SP: ( i am trying to add more than 1 field but get the same error
no matter how many i try to add, i thought i would try to insert the primary
key only and work up from there but the...
|
by: Leedrick |
last post by:
Hi,
In the past I have been dealing mainly with sql server, and recently
been given the task of supporting software that uses db2 on as400.
Simple tasks such as executing a stored procedure...
|
by: Mike P |
last post by:
I am using a SqlDataSource with a GridView and stored proc, and I have
specified exactly the same update parameters for the SqlDataSource in
exactly the same order as my stored proc. Yet I keep...
|
by: jkeel |
last post by:
If I try to Update a record with the following code using a stored
procedure I get an error:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$...
|
by: sun919 |
last post by:
hi there... i ve a little question asking concerning saving data into
database
Basically, I have stored procedure name InsertquestionnaireList and the
argument for this is both correct
... I...
|
by: David Lozzi |
last post by:
Howdy,
ASP.Net 2.0 using VB on SQL 2005
This is a two fold issue.
I have a DetailsView control which users can insert or edit items. Editing
works great. Insert works great however I need...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |