Click here to Skip to main content
15,914,408 members
Home / Discussions / C#
   

C#

 
AnswerRe: How do i access MDI parent data from MDI child? Pin
originSH4-Apr-07 2:16
originSH4-Apr-07 2:16 
GeneralRe: How do i access MDI parent data from MDI child? Pin
sinosoidal4-Apr-07 4:00
sinosoidal4-Apr-07 4:00 
Questionhow can get my friend in yahoo messanger? Pin
B.A3-Apr-07 23:28
B.A3-Apr-07 23:28 
AnswerRe: how can get my friend in yahoo messanger? Pin
Christian Graus3-Apr-07 23:47
protectorChristian Graus3-Apr-07 23:47 
AnswerRe: how can get my friend in yahoo messanger? Pin
Sathesh Sakthivel3-Apr-07 23:49
Sathesh Sakthivel3-Apr-07 23:49 
Questionhow to run another exe by ch#.net Pin
abesinghe3-Apr-07 23:20
abesinghe3-Apr-07 23:20 
AnswerRe: how to run another exe by ch#.net Pin
Martin#3-Apr-07 23:23
Martin#3-Apr-07 23:23 
AnswerRe: how to run another exe by ch#.net Pin
coolestCoder3-Apr-07 23:25
coolestCoder3-Apr-07 23:25 
AnswerRe: how to run another exe by ch#.net Pin
Muammar©3-Apr-07 23:50
Muammar©3-Apr-07 23:50 
GeneralRe: how to run another exe by ch#.net Pin
Christian Graus4-Apr-07 0:03
protectorChristian Graus4-Apr-07 0:03 
GeneralRe: how to run another exe by ch#.net Pin
Muammar©4-Apr-07 0:12
Muammar©4-Apr-07 0:12 
GeneralRe: how to run another exe by ch#.net Pin
Martin#4-Apr-07 0:19
Martin#4-Apr-07 0:19 
QuestionGetting a base control from event arg. Pin
Diego F.3-Apr-07 23:14
Diego F.3-Apr-07 23:14 
AnswerRe: Getting a base control from event arg. Pin
joon vh.3-Apr-07 23:24
joon vh.3-Apr-07 23:24 
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 

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.