private void button1_Click(object sender, EventArgs e) { try { // Instantiate the DataServiceContext. context = new db_exerciseEntities(svcUri); // Define a LINQ query that returns Orders and // Order_Details for a specific customer. // var questionQuery = from o in context.Orders.Expand("Order_Details") // where o.Customers.CustomerID == customerId // select o; var questionQuery = from o in context.mchoiceQues select new { o.id, o.question, o.objective, o.con }; //select o; // Create an DataServiceCollection<T> based on // execution of the LINQ query for Orders. // DataServiceCollection<mchoiceQues> mques = new DataServiceCollection<mchoiceQues>(questionQuery); // questionQuery.ToList(); quesView.DataSource = questionQuery.ToList(); // Make the DataServiceCollection<T> the binding source for the Grid. } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public paramst() { String WCFIPstr = ConfigurationManager.AppSettings["WCFIP"].ToString(); context = new db_exerciseEntities(new Uri(WCFIPstr)); // context = new db_exerciseEntities(svcUri); st = new StudInfo(); }
public param() { String WCFIPstr = ConfigurationManager.AppSettings["WCFIP"].ToString(); context = new db_exerciseEntities(new Uri(WCFIPstr)); String maxstr = ConfigurationManager.AppSettings["maxsize"].ToString(); maxsize = long.Parse(maxstr); }
private void adde_Load(object sender, EventArgs e) { context = pp.context; lcs = pp.ltea_c; comboBox5.DataSource = lcs; comboBox5.ValueMember = "CourseName"; comboBox5.Text = ""; comboBox4.SelectedIndex = 0; }
private void addmq_Load(object sender, EventArgs e) { context = pp.context; /* var questionQuery = from o in context.Course * select o; * lcs = questionQuery.ToList<Course>();*/ lcs = pp.ltea_c; comboBox5.DataSource = lcs; comboBox5.ValueMember = "CourseName"; comboBox5.Text = ""; }
private void addA_Load(object sender, EventArgs e) { context = pp.context; /* var questionQuery = from o in context.Course * select o; * lcs = questionQuery.ToList<Course>();*/ lcs = pp.ltea_c; comboBox5.DataSource = lcs; comboBox5.ValueMember = "CourseName"; comboBox5.Text = ""; // String maxstr = ConfigurationManager.AppSettings["maxsize"].ToString(); // maxsize = long.Parse(maxstr); }
private void exerList_Load(object sender, EventArgs e) { context = pp.context; /*var questionQuery = from o in context.Course * select o; * lcs = questionQuery.ToList<Course>(); * */ lcs = pp.ltea_c; comboBox1.DataSource = lcs; comboBox1.ValueMember = "CourseName"; // listBox1.Items.Clear(); // listBox2.Items.Clear(); // comboBox1.Text = ""; }
private void button3_Click(object sender, EventArgs e) { try { // Instantiate the DataServiceContext. context = new db_exerciseEntities(svcUri); // Define a LINQ query that returns Orders and // Order_Details for a specific customer. // var questionQuery = from o in context.Orders.Expand("Order_Details") // where o.Customers.CustomerID == customerId // select o; var questionQuery = from o in context.mchoiceQues where o.id == 5 select o; mchoiceQues mcq = questionQuery.First <mchoiceQues>(); comboBox1.Text = (mcq.objective).ToString(); comboBox2.Text = (mcq.con).ToString(); comboBox3.Text = (mcq.diff).ToString(); comboBox4.Text = (mcq.answ).ToString(); ////////////read richtext System.IO.MemoryStream mstream = new System.IO.MemoryStream(mcq.question, false); this.rquestion.LoadFile(mstream, RichTextBoxStreamType.RichText); //////end read richtext // Make the DataServiceCollection<T> the binding source for the Grid. } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public exerList(param p) { InitializeComponent(); pp = p; context = p.context; }
public addS(param p) { InitializeComponent(); pp = p; context = p.context; }
public classinfoF(param p) { InitializeComponent(); pp = p; context = p.context; }