Click here to Skip to main content
16,010,022 members
Home / Discussions / C#
   

C#

 
QuestionCalling UnManaged Code Pin
satsumatable4-Jun-06 19:50
satsumatable4-Jun-06 19:50 
QuestionHow to copy data from one excel workbook to another Pin
sydney_sider4-Jun-06 18:05
sydney_sider4-Jun-06 18:05 
AnswerRe: How to copy data from one excel workbook to another Pin
Tamimi - Code4-Jun-06 19:25
Tamimi - Code4-Jun-06 19:25 
GeneralRe: How to copy data from one excel workbook to another Pin
sydney_sider4-Jun-06 21:20
sydney_sider4-Jun-06 21:20 
QuestionImage in PictureBox is not showing in run time. [modified] Pin
emran8344-Jun-06 15:26
emran8344-Jun-06 15:26 
AnswerRe: Image in PictureBox is not showing in run time. [modified] Pin
AhsanS5-Jun-06 3:51
AhsanS5-Jun-06 3:51 
QuestionOutlook context menu item Pin
Usman Rauf4-Jun-06 10:47
Usman Rauf4-Jun-06 10:47 
QuestionERROR_HANDLER Pin
Bedevian4-Jun-06 9:39
Bedevian4-Jun-06 9:39 
i am trying to write this code in C#.i have a problem with Err.Number
how can i get error number in C#.
Error number is always Zero but in VB it's show the correct Error Number !!

VB.net
On Error GoTo ERROR_HANDLER
Dim TermID As Int32 = Convert.ToInt32(txtTermId.Text)
Dim EmpNum As Int32 = Convert.ToInt32(EmployeeList.SelectedItem)
objFuncs.LogIn(TermID, EmpNum, "", "")
StatusBar1.Text = "You successfully logged in with Employee " & EmpNum

ERROR_HANDLER:
MessageBox.Show(Err.Number.ToString())
Select Case Err.Number And &HFFF
Case ErrCOM_InvalidEmpPassword : MsgBox("Invalid password")
Case ErrCOM_CouldNotFindEmployeeFromId : MsgBox("Could not find employee from ID")
Case Else : MsgBox(Err.Description)
End Select

C#
try
{
int TermID = Convert.ToInt32(txtTermId.Text);
int EmpNum = Convert.ToInt32(EmployeeID.Text);
objFuncs.LogIn(TermID, EmpNum, "", "");
richTextmsg.Text += "You successfully logged in with Employee " + EmpNum;
}
catch
{

MessageBox.Show(Information.Err().Number.ToString());

switch(Information.Err().Number & 4098)
{
case ErrCOM_EmpLoggedOnOtherTerm:
MessageBox.Show("The employee is logged on to another terminal", 0, null);
break;

case ErrCOM_SomeoneAlreadyLoggedIn:
MessageBox.Show("Someone else is already logged on to this terminal", 0, null);
break;
}


AnswerRe: ERROR_HANDLER Pin
Guffa4-Jun-06 10:21
Guffa4-Jun-06 10:21 
QuestionHelp for serial communication. Pin
AhsanS4-Jun-06 9:38
AhsanS4-Jun-06 9:38 
AnswerRe: Help for serial communication. Pin
Ed.Poore4-Jun-06 11:16
Ed.Poore4-Jun-06 11:16 
GeneralRe: Help for serial communication. Pin
AhsanS4-Jun-06 21:45
AhsanS4-Jun-06 21:45 
GeneralRe: Help for serial communication. Pin
Ed.Poore5-Jun-06 1:19
Ed.Poore5-Jun-06 1:19 
GeneralRe: Help for serial communication. Pin
Ed.Poore5-Jun-06 1:30
Ed.Poore5-Jun-06 1:30 
Questioni use now a parameterized query but still get an error [modified] Pin
TheBeginner774-Jun-06 8:56
TheBeginner774-Jun-06 8:56 
AnswerRe: i use now a parameterized query but still get an error Pin
NaNg152414-Jun-06 9:30
NaNg152414-Jun-06 9:30 
AnswerRe: i use now a parameterized query but still get an error [modified] Pin
Guffa4-Jun-06 10:23
Guffa4-Jun-06 10:23 
AnswerRe: i use now a parameterized query but still get an error Pin
Rob Graham4-Jun-06 11:47
Rob Graham4-Jun-06 11:47 
Questiona special Format For MaskedTextBox [modified] Pin
mostafa_h4-Jun-06 8:53
mostafa_h4-Jun-06 8:53 
AnswerRe: a special Format For MaskedTextBox [modified] Pin
NaNg152414-Jun-06 9:33
NaNg152414-Jun-06 9:33 
GeneralRe: a special Format For MaskedTextBox [modified] Pin
mostafa_h5-Jun-06 2:03
mostafa_h5-Jun-06 2:03 
GeneralRe: a special Format For MaskedTextBox [modified] Pin
NaNg152415-Jun-06 6:20
NaNg152415-Jun-06 6:20 
GeneralRe: a special Format For MaskedTextBox [modified] Pin
malikjhangirahmed@hotmail.com5-Jun-06 7:26
malikjhangirahmed@hotmail.com5-Jun-06 7:26 
GeneralRe: a special Format For MaskedTextBox [modified] Pin
mostafa_h5-Jun-06 8:54
mostafa_h5-Jun-06 8:54 
QuestionScrolling a panel via code (without its scrollbars) problem [modified] Pin
3Dizard4-Jun-06 8:12
3Dizard4-Jun-06 8:12 

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.