用SQL SERVER做数据库,用DataForm Wizard建立父子导航窗口之后,添加,删除,更改等功能全部正常,但导航的定位功能不好,因此想添加一个查询功能,例如父子是用"OrderNo"做关联,如何实现通过"OrderNo"来做一个查询功能?多谢!
解决方案 »
- 大家知道的打印标签的方法,哪种比较好用呢。。?求赐教!
- 【C#求助,大哥们请进】timer控件和Form窗体的keydown事件有冲突,怎么办?
- 如何制作一个空间(类似于QQ的)
- textbox 输入显示 * 的写法
- winform下gridview打印如何实现?
- 送分!!!!!!!!!!!!!!!!!!!!!!顺便问个问题
- 怎样才能获取一个PHP页面?
- c#.net c#.net难道就不能手动设置打印纸张的大小?非得利用一个PrintDialog不成?超难!
- 在Web窗体里怎样触发DropDownList的SelectedIndexChanged事件???
- 请教有关类的扩展
- C#.NET 有Document/View吗?
- 如何从控制台读取整形数据保存到整形数组a中,以回车换行结束
DataGrid控件名: grdINVAdjustDetail自动生成的窗口有两个OleDataAdapter,分别用于父子记录的.一个DataSet,一个Connection.我在查询按钮Click事件中改变SelectCommand的Text属性,但是运行时出错.
出错语句: grdINVAdjustDetail.DataSource = null;错误信息:
Additional information: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
另,上面提到的: parentdatagrid 是自定义的对象名吗?
public void FillDataSet(Logistic.DS_InvAdjust dataSet)
{
dataSet.EnforceConstraints = false;
try
{
this.oleDbConnection1.Open();
// Attempt to fill the dataset through the OleDbDataAdapter1.
this.oleDbDataAdapter1.Fill(dataSet);
this.oleDbDataAdapter2.Fill(dataSet);
} finally
{ dataSet.EnforceConstraints = true; this.oleDbConnection1.Close();
} } public void LoadDataSet()
{ Logistic.DS_InvAdjust objDataSetTemp;
objDataSetTemp = new Logistic.DS_InvAdjust();
try
{
// Attempt to fill the temporary dataset.
this.FillDataSet(objDataSetTemp); grdINVAdjustDetail.DataSource = null;
// Empty the old records from the dataset.
objDS_InvAdjust.Clear();
// Merge the records into the main dataset.
objDS_InvAdjust.Merge(objDataSetTemp);
grdINVAdjustDetail.SetDataBinding(objDS_InvAdjust, "INVAdjust.R_InvAdjust");
}