سوال و جواب ها با برچسب برنامه نویسی C




در قسمت 9 ویدیو یاد داده شد که چگونه دو تا ایتم به سبد خرید اضافه کنیم با این کد ها

  protected void AddToShoppingCart_Click(object sender, EventArgs e)
 
{

Button btn = (Button)sender;
if (Session["shoppingCart"]!= null)
{
Session["shoppingCart"] += "," + btn.ToolTip;
}
else
{
Session.Add("shoppingCart", btn.ToolTip);

}

// Response.Redirect("shoppingCart.aspx");
}


و این کد
protected void Page_Load(object sender, EventArgs e) { if (Session["status"] != null && Session["status"].ToString() == "Login") { //successful login sql_addedProds.SelectCommand = "SELECT * FROM [Products] WHERE ([id] in (" + Session["shoppingCart"].ToString() + "))"; } else { Response.Redirect("login.aspx"); } }
ولی وقتی دو ایتم یه سبد اضافه می کنم این ارور را می دهد
Server Error in '/' Application.
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14286670
System.Number.ParseInt32(String s, Num
{
if (Session["status"] != null &&
Session["status"].ToString() == "Login")
{


//successful login
sql_addedProds.SelectCommand = "SELECT * FROM [Products] WHERE ([id] in ("
+ Session["shoppingCart"].ToString() + "))";


}
else
{
Response.Redirect("login.aspx");
}

در قسمت 9 ویدیو یاد داده شد که چگونه دو تا ایتم به سبد خرید اضافه کنیم با این کد ها

  protected void AddToShoppingCart_Click(object sender, EventArgs e)
 
{

Button btn = (Button)sender;
if (Session["shoppingCart"]!= null)
{
Session["shoppingCart"] += "," + btn.ToolTip;
}
else
{
Session.Add("shoppingCart", btn.ToolTip);

}

// Response.Redirect("shoppingCart.aspx");
}


و این کد
protected void Page_Load(object sender, EventArgs e) { if (Session["status"] != null && Session["status"].ToString() == "Login") { //successful login sql_addedProds.SelectCommand = "SELECT * FROM [Products] WHERE ([id] in (" + Session["shoppingCart"].ToString() + "))"; } else { Response.Redirect("login.aspx"); } }
ولی وقتی دو ایتم یه سبد اضافه می کنم این ارور را می دهد
Server Error in '/' Application.
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14286670
System.Number.ParseInt32(String s, Num
{
if (Session["status"] != null &&
Session["status"].ToString() == "Login")
{


//successful login
sql_addedProds.SelectCommand = "SELECT * FROM [Products] WHERE ([id] in ("
+ Session["shoppingCart"].ToString() + "))";


}
else
{
Response.Redirect("login.aspx");
}
در قسمت 9 ویدیو یاد داده شد که چگونه دو تا ایتم به سبد خرید اضافه کنیم با این کد ها

  protected void AddToShoppingCart_Click(object sender, EventArgs e)
 
{

Button btn = (Button)sender;
if (Session["shoppingCart"]!= null)
{
Session["shoppingCart"] += "," + btn.ToolTip;
}
else
{
Session.Add("shoppingCart", btn.ToolTip);

}

// Response.Redirect("shoppingCart.aspx");
}


و این کد
protected void Page_Load(object sender, EventArgs e) { if (Session["status"] != null && Session["status"].ToString() == "Login") { //successful login sql_addedProds.SelectCommand = "SELECT * FROM [Products] WHERE ([id] in (" + Session["shoppingCart"].ToString() + "))"; } else { Response.Redirect("login.aspx"); } }
ولی وقتی دو ایتم یه سبد اضافه می کنم این ارور را می دهد
Server Error in '/' Application.
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14286670
System.Number.ParseInt32(String s, Num
{
if (Session["status"] != null &&
Session["status"].ToString() == "Login")
{


//successful login
sql_addedProds.SelectCommand = "SELECT * FROM [Products] WHERE ([id] in ("
+ Session["shoppingCart"].ToString() + "))";


}
else
{
Response.Redirect("login.aspx");
}


چند سوال تصادفی

فیشیال پوست می‌تواند در هر زمان از سال انجام شود، اما بهترین زمان برای انجام آن، زمانی است که پوست شما به مراقبت و رسیدگی نیاز دارد. به طور کلی، فیشیال پوست را می‌توان هر 4 تا 6 هفته یک بار انجام داد.

دلایل انجام فیشیال پوست در زمان‌های مختلف:

برای پاکسازی پوست از آلودگی‌ها و سلول‌های مرده: فیشیال پوست می‌تواند به پاکسازی پوست از آلودگی‌ها، چربی و سلول‌های مرده کمک کند. این امر می‌تواند به بهبود ظاهر و سلامت پوست کمک کند.
برای درمان مشکلات پوستی: فیشیال پوست می‌تواند به درمان مشکلات پوستی مانند آکنه، لک‌های پوستی و چین و چروک کمک کند.
برای افزایش رطوبت پوست: فیشیال پوست می‌تواند به افزایش رطوبت پوست کمک کند. این امر می‌تواند به جلوگیری از خشکی و ترک خوردن پوست کمک کند.
برای افزایش گردش خون: فیشیال پوست می‌تواند به افزایش گردش خون کمک کند. این امر می‌تواند به بهبود ظاهر و سلامت پوست کمک کند.

نکاتی برای انجام فیشیال پوست:

قبل از انجام فیشیال پوست، با یک متخصص پوست مشورت کنید تا مطمئن شوید که این روش درمانی برای شما مناسب است.
به دنبال یک متخصص پوست با تجربه و مجوز باشید.
قبل از انجام فیشیال پوست، از هرگونه محصولات آرایشی یا بهداشتی استفاده نکنید.
پس از انجام فیشیال پوست، از قرار گرفتن در معرض نور مستقیم خورشید خودداری کنید.

با توجه به نکات ذکر شده، فیشیال پوست می‌تواند یک روش درمانی مفید برای بهبود ظاهر و سلامت پوست باشد. فیشیال



پرسش سوال جدید :: تبلیغات در سوال و جواب :: گروه های سوال و جوابی

تمامی حقوق مادی و معنوی، متعلق به وب سایت سوال جواب (soja.ai) و تیم مدیریتی آن می باشد.

طراحی و اجرا : گروه مشاوران فناوری اطلاعات

پاسخ های موجود در سایت توسط کاربران سایت ثبت می شود،
سایت سوال و جواب هیچ مسئولیتی در قبال صحت و محتوی پاسخ ها ندارد، هرچند تا حد امکان نظارت بر محتوی آنها صورت می گیرد.