hercool
پنج شنبه 31 مرداد 1392, 22:00 عصر
سلام دوستان
من در مرحله ذخیره شدن اطلاعات درون دیتابیس به مشکل خوردم و این پیام رو به من میده
Procedure or function has too many arguments specified in my stored procedure (http://stackoverflow.com/questions/13545995/procedure-or-function-has-too-many-arguments-specified-in-my-stored-procedure)
این کد من هست
public void saveIntraDayPriceData(DataTable x)
{
SqlDataAdapter adapter = new SqlDataAdapter();
SqlCommand command = new SqlCommand("sp_intraday");
command.Connection = con;
command.Connection.Open();
command.CommandType = CommandType.StoredProcedure;
adapter.SelectCommand = command;
for (int b = 0; b < x.Rows.Count; b++)
{
string ti = x.Rows[b]["time"].ToString();
int tim = ti.IndexOf(" "); string tima = ti.Substring(tim + 1, ti.Length);
//string tarikh = ti.Substring(1,9);
//string hajm = x.Rows[i]["Transactionvalue"].ToString();
// int noghteh = hajm.IndexOf("."); hajm = hajm.Substring(0, noghteh);
command.Parameters.Add(new SqlParameter("@codecompany", 6422));
command.Parameters.Add(new SqlParameter("@tarikh", 3));
command.Parameters.Add(new SqlParameter("@timee", x.Rows[b]["time"]));
command.Parameters.Add(new SqlParameter("@price", x.Rows[b]["price"]));
command.Parameters.Add(new SqlParameter("@price1", x.Rows[b]["price1"]));
command.Parameters.Add(new SqlParameter("@price2", x.Rows[b]["price2"]));
command.Parameters.Add(new SqlParameter("@price3", x.Rows[b]["price3"]));
command.Parameters.Add(new SqlParameter("@Turnover", x.Rows[b]["Turnover"]));
}command.ExecuteNonQuery();
//command.Connection.Close();
MessageBox.Show("save intradayprice با موفقیت انجام شد");
}
چک کردم که تعداد پارامتر های ارسالی با پارامتر های داخل استوری پروسیجر برابر باشه و مشکلی نبود و تعداد برابر بود یباز این مشکل پا برجاست
هر کاری کردم نشد ممنون میشم راهنماییم کنید چکار کنم این مشکل رفع بشه
من در مرحله ذخیره شدن اطلاعات درون دیتابیس به مشکل خوردم و این پیام رو به من میده
Procedure or function has too many arguments specified in my stored procedure (http://stackoverflow.com/questions/13545995/procedure-or-function-has-too-many-arguments-specified-in-my-stored-procedure)
این کد من هست
public void saveIntraDayPriceData(DataTable x)
{
SqlDataAdapter adapter = new SqlDataAdapter();
SqlCommand command = new SqlCommand("sp_intraday");
command.Connection = con;
command.Connection.Open();
command.CommandType = CommandType.StoredProcedure;
adapter.SelectCommand = command;
for (int b = 0; b < x.Rows.Count; b++)
{
string ti = x.Rows[b]["time"].ToString();
int tim = ti.IndexOf(" "); string tima = ti.Substring(tim + 1, ti.Length);
//string tarikh = ti.Substring(1,9);
//string hajm = x.Rows[i]["Transactionvalue"].ToString();
// int noghteh = hajm.IndexOf("."); hajm = hajm.Substring(0, noghteh);
command.Parameters.Add(new SqlParameter("@codecompany", 6422));
command.Parameters.Add(new SqlParameter("@tarikh", 3));
command.Parameters.Add(new SqlParameter("@timee", x.Rows[b]["time"]));
command.Parameters.Add(new SqlParameter("@price", x.Rows[b]["price"]));
command.Parameters.Add(new SqlParameter("@price1", x.Rows[b]["price1"]));
command.Parameters.Add(new SqlParameter("@price2", x.Rows[b]["price2"]));
command.Parameters.Add(new SqlParameter("@price3", x.Rows[b]["price3"]));
command.Parameters.Add(new SqlParameter("@Turnover", x.Rows[b]["Turnover"]));
}command.ExecuteNonQuery();
//command.Connection.Close();
MessageBox.Show("save intradayprice با موفقیت انجام شد");
}
چک کردم که تعداد پارامتر های ارسالی با پارامتر های داخل استوری پروسیجر برابر باشه و مشکلی نبود و تعداد برابر بود یباز این مشکل پا برجاست
هر کاری کردم نشد ممنون میشم راهنماییم کنید چکار کنم این مشکل رفع بشه