SQL="select * from v_" + from the Name, the Substring (1, from the Name. The Length - 1) + "order by" + from the Name, the Substring (1, from the Name. The Length - 1) + "ID".
SqlItem="select * from v_" + from the Name, the Substring (1, from the Name. The Length - 1) + "Item" + "order by" + from the Name, the Substring (1, from the Name. The Length - 1) + "ItemID";
DataGridView dv=from the Controls. The Find (" DataGridView ", true) [0] as DataGridView.
DataGridView dvi=from the Controls. The Find (" dataGridViewItem ", true) [0] as DataGridView.
Dv. AutoGenerateColumns=false;
Dvi. AutoGenerateColumns=false;
The DataSet ds=new DataSet ();
SqlDataAdapter masterda=new SqlDataAdapter (SQL, mydate Conn);
Masterda. The Fill (ds, "v_ +" from the Name, the Substring (1, from the Name. The Length - 1));
SqlDataAdapter detailsda=new SqlDataAdapter (sqlItem mydate. Conn);
Detailsda. The Fill (ds, "v_ +" from the Name, the Substring (1, from the Name. The Length - 1) + "Item");
DataRelation base=new DataRelation (ZC,
Ds. Tables [+ "v_" from the Name, the Substring (1, from the Name.) Length - 1]. The Columns [from the Name, the Substring (1, from the Name. The Length - 1) + "ID"],
Ds. Tables [+ "v_" from the Name, the Substring (1, from the Name. The Length - 1) + "Item"]. Columns [from the Name, the Substring (1, from the Name. The Length - 1) + "ID"));
Ds. Relations. The Add (base);
Dv. The DataSource=ds;
Dv. DataMember="v_" + from the Name, the Substring (1, from the Name. The Length - 1);//set up the binding of the main table name
Dvi. DataSource=dv;//set up from the table data
Dvi. DataMember="ZC";//set up the binding of master-slave relationship table name
Run tip unable to create the field of ZC child list
An example of online copy
CodePudding user response:
I am VS2019 case seems to be 2008 how to modifyCodePudding user response:
I don't want to see, guo jiaobu code,You should learn some new framework technology, don't use this kind of old-fashioned things, will make of you head pain
CodePudding user response:
Two layers architecture, don't write so deep, logic, and as I wrote before DELPHI less demanding of CS mode just fast data processingCodePudding user response: