我在ObjectQuery< TblProduct>上发现错误filterdProduct = new ObjectQuery< TblProduct>(" SELECT VALUE P FROM TblProducts AS P" cs); [英] i am geting error at ObjectQuery<TblProduct> filterdProduct = new ObjectQuery<TblProduct>("SELECT VALUE P FROM TblProducts AS P",cs);
问题描述
使用System;
使用System.Collections.Generic;
使用System.ComponentModel;
使用System.Data;
使用System.Drawing;
使用System.Linq;
使用System.Text;
使用System.Threading.Tasks ;
使用System.Windows.Forms;
使用System.Data.Objects;
使用System.Data.SqlClient;
名称空间Coffeeshope
{
公共部分类CostumerOrders:表格
{
private coffeeshopeEntities1 cs = new coffeeshopeEntities1();
private BindingList< tblproduct> products = new BindingList< tblproduct>();
private decimal tt;
公共小数Tt
{
得到{return tt; }
set {tt = value;
txttotal.Text = string.Format({0:c},tt);
}
}
public CostumerOrders()
{
InitializeComponent();
lstProductsChosen.DataSource = products;
lstProductsChosen.DisplayMember =Description;
createtabbedpanel();
}
private void createtabbedpanel()
{
foreach(cslProductType pt in cs.TblProductTypes)
{
tabControl1.TabPages.Add(pt.ProductType.ToString(),pt.Description);
}
}
private void addproducts1()
{
int i = 1;
foreach(TabCon tp in tabControl1.TabPages)
{
ObjectQuery< tblproduct> filterdProduct = new ObjectQuery< tblproduct>(SELECT VALUE P FROM TblProducts AS P,cs);
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.Objects;
using System.Data.SqlClient;
namespace Coffeeshope
{
public partial class CostumerOrders : Form
{
private coffeeshopeEntities1 cs = new coffeeshopeEntities1();
private BindingList<tblproduct> products = new BindingList<tblproduct>();
private decimal tt;
public decimal Tt
{
get { return tt; }
set { tt = value;
txttotal.Text = string.Format("{0:c}", tt);
}
}
public CostumerOrders()
{
InitializeComponent();
lstProductsChosen.DataSource = products;
lstProductsChosen.DisplayMember = "Description";
createtabbedpanel();
}
private void createtabbedpanel()
{
foreach (TblProductType pt in cs.TblProductTypes)
{
tabControl1.TabPages.Add(pt.ProductType.ToString(), pt.Description);
}
}
private void addproducts1()
{
int i = 1;
foreach (TabPage tp in tabControl1.TabPages)
{
ObjectQuery<tblproduct> filterdProduct = new ObjectQuery<tblproduct>("SELECT VALUE P FROM TblProducts AS P",cs);
}
}
推荐答案
参见 https://msdn.microsoft.com/en-us/library/bb738995(v = vs.110).aspx [ ^ ]。如果错误仍然存在,那么您确实需要向我们提供完整的详细信息。
See https://msdn.microsoft.com/en-us/library/bb738995(v=vs.110).aspx[^]. If the error persists, then you really need to give us the full details.
这篇关于我在ObjectQuery< TblProduct>上发现错误filterdProduct = new ObjectQuery< TblProduct>(" SELECT VALUE P FROM TblProducts AS P" cs);的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!