|
Yes sir I have searched but not able to find suitable article...Help me sir..
Dharmaraj
|
|
|
|
|
|
|
when i click on viuew crystal reports..the output is repeated for four/five times in a crystal report
i've chacked the query its correct\dont knw wats the problem
software student
|
|
|
|
|
Hello
i try to count the i have in my form.
i put the try and catch block, in the finally i want to count the number of error i have.
or even if i don't put the try catch block how i can count the error
Thanks in advance
Assaf
|
|
|
|
|
i dont understand your question !!!!
Why you are trying to count. ?
if you use counter in Finally block it always should be 1 cause while any one error occured , code directly jumped to catch block then it will go to finaly.
|
|
|
|
|
Assaf82 wrote: i try to count the i have in my form.
Count what ?
Assaf82 wrote: i put the try and catch block, in the finally i want to count the number of error i have.
Count will be incorrect as finally will be executed all the time. Declare a variable and increment it in each catch block.
Assaf82 wrote: or even if i don't put the try catch block how i can count the error
I think it's not possible. When an unhandled error occurs, application will stop execution.
|
|
|
|
|
|
DharmarajNagarajan wrote: use a flag variable
It is not possible to use flag variable to count the number of error. when any one error will occer it will jump to Catch block, then directly move to finally block. so where you going to use flag !!!!
<br />
Try<br />
{<br />
first here !!!<br />
}<br />
catch ( )<br />
{<br />
if any error<br />
} <br />
Finaly<br />
{<br />
after error occured or not finaly here<br />
}<br />
so , counter is useless !!!!!
|
|
|
|
|
Hi, maybe this is what you want:
int errors=0;
foreach (... in collection) {
try {
...
} catch (Exception exc) {
errors++;
Console.WriteLine("Error "+errors+": "+exc.ToString());
}
}
Console.WriteLine("There were "+errors+" errors");
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I develop an application constitute from many form. the first form (Connection) is to establish the database and after the first form in the application appear
how i can close the connection form when the first form in the application appear.
this is my code:
private void btnCon_Click(object sender, EventArgs e)
{
try
{
dataConnection.Open();
MessageBox.Show(" Test Connection Succeded ", "Microsoft Visual Studio", MessageBoxButtons.OK, MessageBoxIcon.Information);
strcon = dataConnection.ConnectionString;
dataConnection.Close();
}
catch (Exception ex)
{
MessageBox.Show(" Error - Connection " + ex.Message, "Microsoft Visual studio", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
CreditCard.ToBegin n = new CreditCard.ToBegin();
n.servcon = strcon;
n.ShowDialog();
}
}
Assaf
|
|
|
|
|
Change your static void main so it runs your connection form, then your main form. Or, just have your main form be the form that starts the app, and have it show the connection form on startup.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
i will explain,
i m implementing an application where there user need to print a bill when he sells some item to the customers. the bills should contains grid table and some design.
i need to know if i can make the grid with the design as a platform where nothing changes from customer to customer other then details specific to the items and customer details.
did i explaing my point of view.
Thank you
Elie
|
|
|
|
|
|
I am buildin an application in c#, but I have I little problem.
I have six forms,each called frm1 to frm6, and the problem is
how to connect two textboxses in different form. To be more precize
I have a textbox called txtID and I put this in frm1.
In frm6 I put a textbox called "Name" with ID=txtName
So I want textbox with ID:txtName to get the value from textbox
"txtID" from frm1,
so how can I do this? Value from textbox in frm1, to get
in textbox in frm6?
I am new in c#, I was thinking to make
public System.Windows.Forms.textbox txtName
but it doesn't function. Anybody who know this and who want to help
me, write me...
Thanks anyway.
p.s
sorry for bad english in some parts of the text.
kpp
|
|
|
|
|
|
Hi Guys. I have managed to get some code to export data in my Access DB to a CSV file. Now, I have two small issues.
1. I want to mark all the records as they are exported to Y in a column named exported and only export all the records marked as N. Anybody have a suggestion on how I could do this in the export code?
2. When I open the CSV file in Excel I get a few errors. First error says that the file is in a different format than the one specified by the extention. It allows you to continue and then comes up with error "Cannot read the 1st record. The it reports yet another error which says that Excel has determined the file to be a SYLK file but not load it" but it still imports the data into Excel. Any ideas on how I get past this?
Code below:
private void toolStripButton2_Click(object sender, EventArgs e)
{
StreamWriter sw = new StreamWriter(@"C:\nefz.csv", false);
DataTable dt = m_dtCallCentre;
int iColCount = dt.Columns.Count;
for (int i = 0; i < iColCount; i++)
{
sw.Write(dt.Columns[i]);
if (i < iColCount - 1)
{
sw.Write(";");
}
}
sw.Write(sw.NewLine);
foreach (DataRow dr in dt.Rows)
{
for (int i = 0; i < iColCount; i++)
{
if (!Convert.IsDBNull(dr[i]))
{
sw.Write(dr[i].ToString());
}
if (i < iColCount - 1)
{
sw.Write(";");
}
}
sw.Write(sw.NewLine);
}
sw.Close();
}
|
|
|
|
|
u can manually xport the data in MDB as CSV, from import/export option in MS Access. And i guess from there u can update the coluns to y/n thru ur application.
Cheers
Bino
www.codepal.co.nr
|
|
|
|
|
Yeah, I guess I can do that but that is not what I want to do. I want to do the export through code. This will be done by a user once I get it to work.
Anybody else able to help out maybe or suggest something?
|
|
|
|
|
Can anybody else please have a look at the Original post please?
|
|
|
|
|
I am working on runtime application. I put 10 buttons and I gave random images to button's bacgroundimages.
I arranged that, when I click the button, if backgroundimage=null, it changes to normal assigned backgroundimage,
if background image is normal background image,it changes to null. One click shows bacgroundimage, second click closing this.
In form loading, all buttons's bacgroundimages are null.
I click first button and open it's backgroundimage, after I click second button and open it's backgroundimage also.
Now, i want to compare whether first clicked button's background image is the same to second clicked button's backgroundimage.
İf It is the same, I make these two buttons's enabled false, if it is not same, I make only the button's bakgoundimages null.
How can I do this.
Thans for your possible help.
|
|
|
|
|
is there a way to design a platform where i can fill in the blanks inside the application using c sharp
Elie
|
|
|
|
|
Hi Elie,
While post a question in the forum always put your question or problem on subject field , not like Hello All, Hello Again etc.
And regarding your question , is it not clear to me . can you kindly explain in details ???
|
|
|
|
|
What Abhijit has pointed out is correct. pls be bit more specific while explaining ur requirement, otherwise how u think u will get an answer?
Cheers
Bino
www.codepal.co.nr
|
|
|
|