צפיות
תשובות
עזרה דחופה בהוספת רשומות לDB והזנתם לתצוגה בGRIDVIEW
אני רק רוצה בתכלס, שהנתונים שהמשתמש בוחר בהזמנה יעברו ויוצגו בסל שלואני משתמש בשפת C# וLINQ TO SQL (כולל מיפוי) ושימוש בASP.NETתודה רבה רבה, צריך היום בערב (שלישי) להגיד את הפרוייקט וזה הפאק היחידי שיש לי בו
protected void ddamount_SelectedIndexChanged(object sender, EventArgs e)
{
empanadasLogic empa = new empanadasLogic();
DataClassesDataContext db = new DataClassesDataContext();
HttpCookie aCookie = Request.Cookies["costumerIdCookie"];
int i = int.Parse(Server.HtmlEncode(aCookie.Value));
var name = empa.SearchNameById(i);
var cName = from order in db.costumers where order.CustomerID == i select order.FirstName.SingleOrDefault();
var qAdress =
from adress in db.costumers
where adress.CustomerID == i
select adress.Address.SingleOrDefault();
var qCity =
from ci in db.costumers
where ci.CustomerID == i
select ci.City.SingleOrDefault();
var qD =
from d in db.costumers
where d.CustomerID == i
select d.allEmpanadasTable.name.SingleOrDefault();
var amount = ddamount.SelectedValue;
Order o = new Order();
var emp = GridView1.SelectedValue;
o.OrderDate = DateTime.Now;
o.details =qD.ToString();
if (Request.Cookies["costumerIdCookie"] != null)
{
HttpCookie bCookie = Request.Cookies["costumerIdCookie"];
o.CustomerID = int.Parse(Server.HtmlEncode(bCookie.Value));
}
o.CostumerName =cName.ToString();
o.ShipAdress = qAdress.ToString(); ;
o.ShipCity = qCity.ToString(); ;
o.Amount = int.Parse(amount);
db.Orders.InsertOnSubmit(o);
db.SubmitChanges();
} והוא נותן לי את השגיאה הבאה: אין תמיכה באופרטורים של רצף עבור הסוג 'System.String'.
אין תמיכה באופרטורים של רצף עבור הסוג 'System.String'.
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.NotSupportedException: אין תמיכה באופרטורים של רצף עבור הסוג 'System.String'.
Source Error:
Line 66: var emp = GridView1.SelectedValue;
Line 67: o.OrderDate = DateTime.Now;
Line 68: o.details =qD.ToString();
Line 69:
Line 70: if (Request.Cookies["costumerIdCookie"] != null)
Source File: h:פרוייקט אתר אמפאנאדסEmpanadas Siteempanadas.aspx.cs Line: 68
Stack Trace:
0 תשובות