getDataIntoDataTable.cs This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters ///

/// Common method for Getting data as Datatable with connection string /// /// /// /// Table Name /// public DataTable GetDataTable ( string ConnectionString , string CmdText , string TableName ) { DB2Connection Con ; Con = new DB2Connection ( ConnectionString ) ; DB2Command cmd = new DB2Command ( ) ; cmd . CommandText = CmdText ; cmd . Connection = Con ; Con . Open ( ) ; DataTable DTT = new DataTable ( ) ; DB2DataAdapter da = new DB2DataAdapter ( ) ; da . SelectCommand = cmd ; da . Fill ( DTT ) ; DTT . TableName = TableName ; Con . Close ( ) ; return DTT ; } //Example Call: //DtUser = GetDataTable(ConnectionString, CmdText, "USER"); //Where DtUser is an empty Datatable //ConnectionString = server=SERVERNAME:60018;database=DBNAME;user Id=USERNAME;password=PASSWORD;currentSchema=SCHEMANAME;persist security info=true;Connection Lifetime=600;Pooling=true;Connect Timeout=30; //CmdText = SELECT USER_ID FROM USER WHERE UPPER(USER_LAN_CODE) = 'LANID_1' WITH UR