Click here to Skip to main content
15,918,109 members
Home / Discussions / C#
   

C#

 
QuestionExpression too complex Pin
joeyan3-Jun-08 18:01
joeyan3-Jun-08 18:01 
AnswerRe: Expression too complex Pin
Christian Graus3-Jun-08 18:15
protectorChristian Graus3-Jun-08 18:15 
GeneralRe: Expression too complex Pin
leppie3-Jun-08 18:24
leppie3-Jun-08 18:24 
GeneralRe: Expression too complex Pin
PIEBALDconsult3-Jun-08 19:29
mvePIEBALDconsult3-Jun-08 19:29 
GeneralRe: Expression too complex Pin
leppie3-Jun-08 23:42
leppie3-Jun-08 23:42 
GeneralRe: Expression too complex Pin
PIEBALDconsult4-Jun-08 7:34
mvePIEBALDconsult4-Jun-08 7:34 
GeneralRe: Expression too complex Pin
leppie4-Jun-08 9:05
leppie4-Jun-08 9:05 
GeneralRe: Expression too complex Pin
joeyan3-Jun-08 22:27
joeyan3-Jun-08 22:27 
Hi all, thx for your reply.

The system use DataAdapter.Update() to update dataset

When user click SAVE button, it would run the following function.

AppFacade.SaveApp(dbConnectionString, dsAppData);


And SaveApp function as follows:


public void SaveApp(String dbConnectionString, DataSet dsData)
{

DBExecute dbexe = new DBEngine.DBExecute();
DataTable dtApp = dsData.Tables[AppData.SYS_TABLE_NAME];
DataTable dtLoc = dsData.Tables[AppDetailData.SYS_PROJ_LOCATION_TABLE];
......
......
try
{
dbexe.dbConnectionString = dbConnectionString;
dbexe.TransactionInitial();
dbexe.UpdateDataTable(dtApp);
dbexe.UpdateDataTable(dtExtApp);
......
......
dbexe.TransactionComplete();
}
catch (Exception e)
{
dbexe.TransactionRollBack();
throw e;
}
finally
{
dbexe = null;
dtApp = null;
dtExtApp = null;
......
......
}
}




// Public functions to update a datatable



public int UpdateDataTable(DataTable dt)
{
this.BuildCommands(dt.TableName);

if (dt.GetChanges() != null)
{
int intRtn = pAdapter.Update(dt.GetChanges());
return intRtn;
}
else
return 0;
}



public int UpdateDataTable(DataSet ds, string tableName)
{
this.BuildCommands(tableName);

if (ds.Tables[tableName].GetChanges() != null)
return pAdapter.Update(ds.GetChanges(), tableName);
else
return 0;
}



....

....



/// Public functions to build SQL command and parameters
private void BuildCommands(string tableName)
{
string strCommand = "SELECT * FROM " + tableName;

OleDbCommand comm = new OleDbCommand(strCommand, pConnection);
comm.CommandType = CommandType.Text;
comm.Transaction = myTrans;

pAdapter.SelectCommand = comm;

OleDbCommandBuilder cb = new OleDbCommandBuilder(pAdapter);
pAdapter.InsertCommand = cb.GetInsertCommand();
pAdapter.UpdateCommand = cb.GetUpdateCommand();
pAdapter.DeleteCommand = cb.GetDeleteCommand();

pAdapter.SelectCommand.Transaction = myTrans;
pAdapter.InsertCommand.Transaction = myTrans;
pAdapter.UpdateCommand.Transaction = myTrans;
pAdapter.DeleteCommand.Transaction = myTrans;
}
GeneralRe: Expression too complex Pin
PIEBALDconsult4-Jun-08 7:33
mvePIEBALDconsult4-Jun-08 7:33 
QuestionDynamaic GridView Issue Pin
GroCareer3-Jun-08 16:46
GroCareer3-Jun-08 16:46 
AnswerRe: Dynamaic GridView Issue Pin
Ashfield3-Jun-08 21:09
Ashfield3-Jun-08 21:09 
Questionthread ID Pin
George_George3-Jun-08 15:40
George_George3-Jun-08 15:40 
AnswerRe: thread ID Pin
Luc Pattyn3-Jun-08 16:46
sitebuilderLuc Pattyn3-Jun-08 16:46 
GeneralRe: thread ID Pin
George_George3-Jun-08 17:02
George_George3-Jun-08 17:02 
GeneralRe: thread ID Pin
anujarya_20013-Jun-08 18:19
anujarya_20013-Jun-08 18:19 
GeneralRe: thread ID Pin
George_George3-Jun-08 18:22
George_George3-Jun-08 18:22 
GeneralRe: thread ID Pin
anujarya_20013-Jun-08 18:48
anujarya_20013-Jun-08 18:48 
GeneralRe: thread ID Pin
George_George3-Jun-08 18:50
George_George3-Jun-08 18:50 
GeneralRe: thread ID Pin
Luc Pattyn3-Jun-08 23:38
sitebuilderLuc Pattyn3-Jun-08 23:38 
GeneralRe: thread ID Pin
George_George3-Jun-08 23:49
George_George3-Jun-08 23:49 
GeneralRe: thread ID Pin
Luc Pattyn4-Jun-08 0:07
sitebuilderLuc Pattyn4-Jun-08 0:07 
GeneralRe: thread ID Pin
George_George4-Jun-08 0:44
George_George4-Jun-08 0:44 
GeneralRe: thread ID Pin
Luc Pattyn4-Jun-08 0:52
sitebuilderLuc Pattyn4-Jun-08 0:52 
GeneralRe: thread ID Pin
George_George4-Jun-08 1:11
George_George4-Jun-08 1:11 
GeneralRe: thread ID Pin
Luc Pattyn4-Jun-08 1:47
sitebuilderLuc Pattyn4-Jun-08 1:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.