|
Procedure or Function 'SubmitRecord1' expects parameter '@ID', which was not supplied.this is the error i am getting while insert into data base using stored procedure can any body help me plz...
|
|
|
|
|
NRHSR wrote: Procedure or Function 'SubmitRecord1' expects parameter '@ID', which was not supplied
How can an error message be more clear?
|
|
|
|
|
pass parameter '@ID' value to Procedure or Function 'SubmitRecord1'
Mahendra Bisht.
|
|
|
|
|
I recommend a job at McDonalds. It seems that computing is too hard for you. The error means what it says.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
"What do you mean, 'I din't give you any fries?'
Nah - too complex.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Procedure or Function 'SubmitRecord1' expects parameter '@ID', which was not supplied. this is the exception i am getting when i run.and my code is
protected void Submit1_ServerClick(object sender, EventArgs e)
{
string constr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True";
SqlConnection con = new SqlConnection(constr);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd = new SqlCommand("SubmitRecord1", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter sp1 = new SqlParameter("@ID",SqlDbType.NVarChar,10);
sp1.Value = TextBox1.Text;
SqlParameter sp2 = new SqlParameter("@Password",SqlDbType.NVarChar,50);
sp2.Value = TextBox2.Text;
SqlParameter sp3 = new SqlParameter("@ConfirmPassword",SqlDbType.NVarChar,50);
sp3.Value = TextBox3.Text;
SqlParameter sp4 = new SqlParameter("@EmailID",SqlDbType.NVarChar,200);
sp4.Value = TextBox4.Text;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
//cmd.ExecuteNonQuery();
}
my stored procedure is
CREATE PROCEDURE dbo.SubmitRecord1
(
@ID varchar(10),
@Password varchar(50),
@ConfirmPassword varchar(50),
@EmailID varchar(200)
)
AS
INSERT INTO login1(ID,Password,ConfirmPassword,EmailID)VALUES(@ID,@Password,@ConfirmPassword,@EmailID)
RETURN
i am passing parameter ... then also its throwing exception......
can any body help me ...
|
|
|
|
|
You're not adding any of the parameters to the command object
something like
cmd.Parameters.Add(sp1);
(Look it up - I don't have an example in front of me - but that's the issue here - upir cmd object doesn't know about the parameters.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
protected void Submit1_ServerClick(object sender, EventArgs e)
{
string constr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True";
SqlConnection con = new SqlConnection(constr);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd = new SqlCommand("SubmitRecord1", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@ID", SqlDbType.NVarChar,10).Value = TextBox1.Text;
cmd.Parameters.Add("@Password", SqlDbType.NVarChar, 50).Value = TextBox2.Text;
cmd.Parameters.Add("@ConfirmPassword", SqlDbType.NVarChar, 50).Value = TextBox3.Text;
cmd.Parameters.Add("@EmailID", SqlDbType.NVarChar, 200).Value = TextBox4.Text;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
stored procedure
ALTER PROCEDURE dbo.SubmitRecord1
(
@ID varchar(10),
@Password varchar(50),
@ConfirmPassword varchar(50),
@EmailID varchar(200)
)
AS
INSERT INTO login1(ID,Password,ConfirmPassword,EmailID)VALUES(@ID,@Password,@ConfirmPassword,@EmailID)
RETURN
this worked fine.....
for reference u can see link
Thanks any ways
|
|
|
|
|
i m using asp.net with c# and in backend using sql server 2000.
i have a table1(material_incoming) and i m using gridview for showing data of table1,when i click edit button at gridview,present value save in table2(edit_tab)with remark "before edit" and after updation,updated value save in table2 with remark "after edit" and also update table1.
prateek srivastava
prateekfgiet@gmail.com
modified on Monday, March 9, 2009 3:20 AM
|
|
|
|
|
I am sorry, but your question makes no sense. Try to rephrase it.
|
|
|
|
|
Is this a question ? If it is, is it a 'I did some research and tried this but it doesn't work' question, or an 'I'm a dumbass, do my job for me' question ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am developing an ASP.NET application and i want to prevent the right click option for a particular page .How can it be achieved is there any javascript.
Thanx in advance.
|
|
|
|
|
Just Add this line in body tag
oncontextmenu="return false;"
Fastrythem
|
|
|
|
|
<HTML>
<script language="javascript">
function preventEvt(evt)
{
evt.returnValue = false;
if( evt.preventDefault ) evt.preventDefault();
return false;
}
</script>
<BODY oncontextmenu="return preventEvt(event)" onmousedown="return preventEvt(event)">
</BODY>
</HTML>
This code can works in IE and Firefox, but no way in Opera
|
|
|
|
|
There are ways to convince an ignorant client that you did this, but I guarantee you that I can circumvent all of them, if I really wanted to right click on your web page.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
amen.
What exactly are you trying to prevent?
|
|
|
|
|
function click(e)
{
if (document.all)
{
if (event.button == 2)
{
alert('Right Click Not Allowed');
return false;
}
}
if (document.layers)
{
if (e.which == 3)
{
alert('Right Click Not Allowed');
return false;
}
}
}
if (document.layers)
{
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
use this code in javascript
Mahendra Bisht.
|
|
|
|
|
Is there any way to track the changes done on another website. Like if there any price change of a perticular product on a product site then it should be reflected on my website.
Mahendra Bisht.
|
|
|
|
|
MB_1981 wrote: Is there any way to track the changes done on another website. Like if there any price change of a perticular product on a product site then it should be reflected on my website.
How did you read the content from other site? using RSS or What ?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
right now i have not apporached any way to read the contents from another site.
Mahendra Bisht.
|
|
|
|
|
If you're talking about a simple web site where they ain't providing any sort of web service, or functionality then the only way to do it would be to store a copy and periodically compare the current version with your stored version.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
there may be more then one website and they are not providing any webservice.
Mahendra Bisht.
|
|
|
|
|
MB_1981 wrote: there may be more then one website and they are not providing any webservice.
then how you are going to read the data. I think first of all you should know how to read the data from that sites, then only you can think of update.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
yes, u r absolutely right.
Mahendra Bisht.
|
|
|
|
|