|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
C#Net 2003 - TRY/CATCH MessageBox.show not working
Hi Everyone.
I need your help. I am using C#.NET 2003 to create this block of script:- try { SqlConnection sqlConn = new SqlConnection(connStr); SqlCommand sqlCmd = New SqlCommand; SqlCmd.Connection = sqlConn; sqlCmd.CommandType = CommandType.Text; sqlCmd.CommandText = "Select * From TblCustomer"; sqlCmd.Connection.Open(); int intCnt = sqlCmd.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { sqlCMD.Connection.CLOSE(); } -------------------------------------------------------------- This error message listed below was generated on script compilation:- "The type or namespace name 'MessageBox' could not be found (are you missing a using directive or an assembly reference?)"
__________________
Cheers, Lennie |
|
#2
|
||||
|
||||
|
Moved From C++ to .NET section
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section. ![]() Please use [Code]your code goes in here[/Code] tags when posting code. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. Modifications Required For VB6 Apps To Work On Vista ![]() Microsoft MVP 2005/2006/2007/2008/2009 |
|
#3
|
||||
|
||||
|
Windows.Forms namespace
The MessageBox is only availible from Windows.Forms namespace.
|
|
#4
|
|||
|
|||
|
Hi Csillagyitzik and Hack,
Yee...Haaa.......my script is working now based on your suggestion. Thank you very very much for sharing your knowledge with me. As a newbie to C#Net 2003 with the information from both of you makes my life easy. Thanks to both of you. Both of you are awesome and generous with information. Have a good Day.
__________________
Cheers, Lennie |
|
#5
|
||||
|
||||
|
I know I've said it before Lennie, but you really should upgrade from 2003.
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section. ![]() Please use [Code]your code goes in here[/Code] tags when posting code. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. Modifications Required For VB6 Apps To Work On Vista ![]() Microsoft MVP 2005/2006/2007/2008/2009 |
|
#6
|
|||
|
|||
|
Hi Hack,
Would love to upgrade Net 2003 but the company that I am working for, is reluctant to the upgrade. I have another problem which I have submitted it's about adding CheckBox in DataGrid for all the Rows. Please help me, Hack. Thanks ,
__________________
Cheers, Lennie |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UPDATE SQL Not working under VB.Net 2003 | Lennie | .NET | 2 | 06-17-2009 05:52 AM |
| error in deploying outlook 2003 addin (in client`s system) | pranava | .NET | 0 | 03-12-2009 06:03 AM |
| ACCESS 2003 SQL LIKE Operator not working in VB6 runtime | Lennie | VB Classic | 4 | 05-29-2008 06:39 PM |
| TierDeveloper Full-Integration with Microsoft Visual Studio .NET 2003 IDE | Zahid Iqbal | dotnet.announcements | 0 | 05-20-2003 08:06 AM |