Click here to Skip to main content
15,884,425 members
Home / Discussions / C#
   

C#

 
GeneralRe: Getting a base control from event arg. Pin
Diego F.3-Apr-07 23:57
Diego F.3-Apr-07 23:57 
GeneralRe: Getting a base control from event arg. Pin
joon vh.4-Apr-07 0:04
joon vh.4-Apr-07 0:04 
GeneralRe: Getting a base control from event arg. Pin
Diego F.4-Apr-07 1:02
Diego F.4-Apr-07 1:02 
GeneralRe: Getting a base control from event arg. Pin
Diego F.4-Apr-07 1:05
Diego F.4-Apr-07 1:05 
GeneralRe: Getting a base control from event arg. Pin
Diego F.4-Apr-07 1:34
Diego F.4-Apr-07 1:34 
QuestionMy Application takes 5 hours to run Pin
rkherath3-Apr-07 22:40
rkherath3-Apr-07 22:40 
AnswerRe: My Application takes 5 hours to run Pin
Colin Angus Mackay3-Apr-07 22:46
Colin Angus Mackay3-Apr-07 22:46 
GeneralRe: My Application takes 5 hours to run Pin
rkherath3-Apr-07 22:55
rkherath3-Apr-07 22:55 
Hi,

ya its like this i have created oledb connection to create connection to the dbase tales.

I have 112 folders containing 6tdbase tables in each.

coding:

//reading from dbase
public void PluFill(string DBFpath)
{
try
{
oledbConnectionMethod(DBFpath);
oledbselctString = "SELECT PLU_NUM AS SKU,DESC AS Description,O_CP*Q_OPEN AS OpeningCP,Q_OPEN AS OpeningQty,Cost_Price*Qty AS ClosingCP,Qty AS ClosingQty FROM PLU";
oledbSelectMethod(oledbselctString);
oledbDataAdapterMethod();
oledbDataadapter.Fill(this.dsPlu);
}
catch (Exception Exp)
{
AppendToFile(DBFpath, Exp.ToString() + oledbselctString.ToString());
}

}

//writing to sql:

public void PluUpdate(string locationNam,string Year,string Month)
{
//opening the sql connection
if (sqlConnection.State == ConnectionState.Closed)
{
sqlConnection.Open();
}


//passing the dataset values to the data table
DataTable dt = dsPlu.Tables[0];

SqlCommand sqlInsertCommand=new SqlCommand();
sqlInsertCommand.Connection = sqlConnection;
//reading from the data table and wrinting to the sql table
foreach (DataRow dr in dt.Rows)
{

try
{
if (dr["OpeningCP"].ToString() == "")
dr["OpeningCP"] = 0;

if (dr["OpeningQty"].ToString() == "")
dr["OpeningQty"] = 0;

if (dr["ClosingCP"].ToString() == "")
dr["ClosingCP"] = 0;

if (dr["ClosingQty"].ToString() == "")
dr["ClosingQty"] = 0;

sqlInsertCommand.CommandText = "Insert into tblBalance_Monthly(cYear,cMonth,cLocationCode,cCategoryCode,cSubCategoryCode,cSKU,cDescription,nO_CostPrice,nO_Qty,nC_CostPrice,nC_QTY) values(\'" + Year + "\',\'" + Month + "\',\'" + locationNam + "\',\'" + dr["SKU"].ToString().Substring(0, 2) + "\',\'" + dr["SKU"].ToString().Substring(0, 3) + "\',\'" + dr["SKU"] + "\',\'" +
dr["Description"].ToString() + "\'," + dr["OpeningCP"] + "," + dr["OpeningQty"] + "," + dr["ClosingCP"] + "," + dr["ClosingQty"] + ")";

sqlDataAdapter.InsertCommand =sqlInsertCommand;

sqlInsertCommand.ExecuteNonQuery();
}
catch (Exception Exp)
{
AppendToFile(locationNam, Exp.ToString() + sqlInsertCommand.ToString());
}

}

}


//and i read the locations of the dbase tables through a class and for each location i perform writing and reding

void callTranfer(string Year, string Month, DateTime TXNDATE, string User_ID, string DriverLoc)
{
//object []retArray=new object[2];
DBCon dbcon = new DBCon();

DataTable dt = dbcon.LocationsFill().Tables[0];
Transfer.TransferClass tran = new Transfer.TransferClass();

int value=0;

foreach (DataRow dr in dt.Rows)
{
string folNam = (dr["Dir"].ToString());
DirectoryInfo forlderPath = new DirectoryInfo(string.Concat(DriverLoc, folNam));
//trnsName = forlderPath.ToString();
tran.PluFill(forlderPath.ToString());
tran.PluUpdate(folNam,Year,Month);
tran.Stk_tranRecieptFill(forlderPath.ToString());
tran.Stk_tranRecieptUpdate(Year, Month, folNam, TXNDATE, User_ID);
tran.Stk_tranIssuesFill(forlderPath.ToString());
tran.Stk_tranIssuesUpdate(Year, Month, folNam, TXNDATE, User_ID);
tran.salesFill(forlderPath.ToString());
tran.SalesUpdate(Year, Month, folNam, TXNDATE, User_ID);
tran.adjustmentsFill(forlderPath.ToString());
tran.adjustmentsUpdate(Year, Month, folNam, TXNDATE, User_ID);
tran.reclassificationsFromFill(forlderPath.ToString());
tran.reclassificationsFromUpdate(Year, Month, folNam, TXNDATE, User_ID);
tran.reclassificationsToFill(forlderPath.ToString());
tran.reclassificationsToUpdate(Year, Month, folNam, TXNDATE, User_ID);


DisplayText(folNam);
value = value + 1;
backgroundWorker1.ReportProgress(value);
}
}



plz help me

Regards
Ruwandi




rkherath
GeneralRe: My Application takes 5 hours to run Pin
V.3-Apr-07 23:37
professionalV.3-Apr-07 23:37 
GeneralRe: My Application takes 5 hours to run Pin
rkherath3-Apr-07 23:58
rkherath3-Apr-07 23:58 
GeneralRe: My Application takes 5 hours to run Pin
Christian Graus4-Apr-07 0:04
protectorChristian Graus4-Apr-07 0:04 
GeneralRe: My Application takes 5 hours to run Pin
V.4-Apr-07 0:09
professionalV.4-Apr-07 0:09 
AnswerRe: My Application takes 5 hours to run Pin
joon vh.3-Apr-07 22:48
joon vh.3-Apr-07 22:48 
GeneralRe: My Application takes 5 hours to run Pin
rkherath3-Apr-07 22:59
rkherath3-Apr-07 22:59 
QuestionSQL Server 2005, Usage % all databases using performance counters!! Pin
Adeel Chaudhry3-Apr-07 21:26
Adeel Chaudhry3-Apr-07 21:26 
Generaladd to above... Pin
Adeel Chaudhry3-Apr-07 21:27
Adeel Chaudhry3-Apr-07 21:27 
QuestionQuery [modified] Pin
Nekshan3-Apr-07 21:09
Nekshan3-Apr-07 21:09 
AnswerRe: Query Pin
Christian Graus3-Apr-07 21:53
protectorChristian Graus3-Apr-07 21:53 
GeneralRe: Query Pin
joon vh.3-Apr-07 22:33
joon vh.3-Apr-07 22:33 
Questiongrid control Pin
Enter the Dragon3-Apr-07 20:34
Enter the Dragon3-Apr-07 20:34 
AnswerRe: grid control Pin
Christian Graus3-Apr-07 20:46
protectorChristian Graus3-Apr-07 20:46 
GeneralRe: grid control Pin
joon vh.3-Apr-07 22:38
joon vh.3-Apr-07 22:38 
AnswerRe: grid control Pin
sudhakar_vaddepalli3-Apr-07 23:05
sudhakar_vaddepalli3-Apr-07 23:05 
QuestionIs it possible to use visual effect to show data from different sources? Pin
Khoramdin3-Apr-07 20:28
Khoramdin3-Apr-07 20:28 
AnswerRe: Is it possible to use visual effect to show data from different sources? Pin
Christian Graus3-Apr-07 20:32
protectorChristian Graus3-Apr-07 20:32 

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.