Hello people.. I'm new to this forums.. Plus, its my first day on a job (Just finished college) And my first assignment is.. Converting a VB6 code to a C# code.. I'm stuck at understanding the programmers code plus the comments on the program is not really helpfull..
Here is a sample that I tried using the VB to C# converter..
------Initialized variables------------------------------
//ado connection
private ADODB.Connection conData = new ADODB.Connection();
private ADODB.Recordset recData = new ADODB.Recordset();
private ADODB.Recordset recRNum = new ADODB.Recordset();
//dao connections
DAO.Database daodb;
//UPGRADE_WARNING: Arrays in structure daors may need to be initialized before they can be used. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="814DF224-76BD-4BB4-BFFB-EA359CB9FC48"'
DAO.Recordset daors;
//validation
string strSql;
string strCode;
string msgAmtErr;
string msgRecNoErr;
string strRecNo;
string tmpErr;
bool flgCode;
bool flgDte;
bool flgForm;
bool flgAmt;
bool flgrecNo;
bool flgExists;
string mainAmtErr;
//getting bank code
string xBnkInd;
string Sqlbank;
string subBnkInd;
//passed parameters
string xBank;
string xFilePath;
string xTrdate;
//sys object
Scripting.FileSystemObject fsys = new Scripting.FileSystemObject();
string sFile;
string CDRCFile;
Scripting.TextStream txtErr;
//balancing figures
decimal cmpFri;
decimal cmpSat;
decimal cmpSun;
decimal cmpMon;
decimal cmpTue;
decimal cmpWed;
decimal cmpThur;
decimal amtFri;
decimal amtSat;
decimal amtSun;
decimal amtMon;
decimal amtTue;
decimal amtWed;
decimal amtThur;
decimal schedAmt;
decimal schedCmp;
short EODval;
string SchedDay;
bool flgAmtValid;
bool flgBalStat;
string msgBalErr;
------One of the function that failed to update to C#-------
//Get compared amount for RB
private void SetCmpAmountRB()
{
// ERROR: Not supported in C#: OnErrorStatement
{
if (!string.IsNullOrEmpty(daors.Fields("amt1").Value)) cmpFri = (decimal)daors.Fields("amt1").Value;
if (!string.IsNullOrEmpty(daors.Fields("AMT2").Value)) cmpSat = (decimal)daors.Fields("AMT2").Value;
if (!string.IsNullOrEmpty(daors.Fields("AMT3").Value)) cmpSun = (decimal)daors.Fields("AMT3").Value;
if (!string.IsNullOrEmpty(daors.Fields("AMT4").Value)) cmpMon = (decimal)daors.Fields("AMT4").Value;
if (!string.IsNullOrEmpty(daors.Fields("AMT5").Value)) cmpTue = (decimal)daors.Fields("AMT5").Value;
if (!string.IsNullOrEmpty(daors.Fields("AMT6").Value)) cmpWed = (decimal)daors.Fields("AMT6").Value;
if (!string.IsNullOrEmpty(daors.Fields("AMT7").Value)) cmpThur = (decimal)daors.Fields("AMT7").Value;
}
}
I can't understand what those "if" statements mean (I mean, if not string is null or empty????) , plus the (!string.isNullorEmpty) return value is.
I also did a little research about dao, and on one web site, it states that DAO is pretty much useless now.. and I can't get the commands right for C# to extract data from the data base (using a MSExcel database)
I hope you people can help me.. I've been trying to figure this thing out for 5 days, and still no luck.