Click here to Skip to main content
15,844,903 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do i access MDI parent data from MDI child? Pin
sinosoidal4-Apr-07 5:00
sinosoidal4-Apr-07 5:00 
Questionhow can get my friend in yahoo messanger? Pin
B.A4-Apr-07 0:28
B.A4-Apr-07 0:28 
AnswerRe: how can get my friend in yahoo messanger? Pin
Christian Graus4-Apr-07 0:47
protectorChristian Graus4-Apr-07 0:47 
AnswerRe: how can get my friend in yahoo messanger? Pin
Sathesh Sakthivel4-Apr-07 0:49
Sathesh Sakthivel4-Apr-07 0:49 
Questionhow to run another exe by ch#.net Pin
abesinghe4-Apr-07 0:20
abesinghe4-Apr-07 0:20 
AnswerRe: how to run another exe by ch#.net Pin
Martin#4-Apr-07 0:23
Martin#4-Apr-07 0:23 
AnswerRe: how to run another exe by ch#.net Pin
coolestCoder4-Apr-07 0:25
coolestCoder4-Apr-07 0:25 
AnswerRe: how to run another exe by ch#.net Pin
Muammar©4-Apr-07 0:50
Muammar©4-Apr-07 0:50 
GeneralRe: how to run another exe by ch#.net Pin
Christian Graus4-Apr-07 1:03
protectorChristian Graus4-Apr-07 1:03 
GeneralRe: how to run another exe by ch#.net Pin
Muammar©4-Apr-07 1:12
Muammar©4-Apr-07 1:12 
GeneralRe: how to run another exe by ch#.net Pin
Martin#4-Apr-07 1:19
Martin#4-Apr-07 1:19 
QuestionGetting a base control from event arg. Pin
Diego F.4-Apr-07 0:14
Diego F.4-Apr-07 0:14 
AnswerRe: Getting a base control from event arg. Pin
joon vh.4-Apr-07 0:24
joon vh.4-Apr-07 0:24 
GeneralRe: Getting a base control from event arg. Pin
Diego F.4-Apr-07 0:57
Diego F.4-Apr-07 0:57 
GeneralRe: Getting a base control from event arg. Pin
joon vh.4-Apr-07 1:04
joon vh.4-Apr-07 1:04 
GeneralRe: Getting a base control from event arg. Pin
Diego F.4-Apr-07 2:02
Diego F.4-Apr-07 2:02 
GeneralRe: Getting a base control from event arg. Pin
Diego F.4-Apr-07 2:05
Diego F.4-Apr-07 2:05 
GeneralRe: Getting a base control from event arg. Pin
Diego F.4-Apr-07 2:34
Diego F.4-Apr-07 2:34 
QuestionMy Application takes 5 hours to run Pin
rkherath3-Apr-07 23:40
rkherath3-Apr-07 23:40 
AnswerRe: My Application takes 5 hours to run Pin
Colin Angus Mackay3-Apr-07 23:46
Colin Angus Mackay3-Apr-07 23:46 
GeneralRe: My Application takes 5 hours to run Pin
rkherath3-Apr-07 23:55
rkherath3-Apr-07 23: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.4-Apr-07 0:37
professionalV.4-Apr-07 0:37 
GeneralRe: My Application takes 5 hours to run Pin
rkherath4-Apr-07 0:58
rkherath4-Apr-07 0:58 
GeneralRe: My Application takes 5 hours to run Pin
Christian Graus4-Apr-07 1:04
protectorChristian Graus4-Apr-07 1:04 
GeneralRe: My Application takes 5 hours to run Pin
V.4-Apr-07 1:09
professionalV.4-Apr-07 1:09 

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.