Messagebox

I am following a coding example from some training materials and my environment is not functioning in quite the same way. In the example when messagebox. is keyed IntelliSense provides a drop down list of methods.

When I do the same I do not get the drop list. Any suggestions will be greatly appreciated. Thanks.

[316 byte] By [dwc] at [2007-12-16]
# 1
It says "New to ASP.NET" in your signature - are you writing WinForms or WebForms? The MessageBox is only available in WinForms.
DanielRieck at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2
Thanks for the reply. I am trying to develop a Web Form. The instructor on the training was demonstrating error handling for an ADO.NET connection and certainly has a Windows Form in the example.

I am looking to display a sqlError exception message from a Try ... Catch.

dwc at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 3

You need to add the following statement at the top of your code file:

VB:


Imports System.Data.SqlClient

C#:


using System.Data.SqlClient

DavidM.Kean at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 4
ADO.NET can be used in either win or web apps, so it doesn't matter which one your instructor used. But you can't use the System.Windows.Forms.MessageBox in a web application (which runs on the server) - you'll need to use client-side java script to display a message box: http://www.freevbcode.com/ShowCode.asp?ID=5918
DanielRieck at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified