|
Mike
Yes they're all SqlClient. I think I will try your method and see how well it works.
Thanks
Jim
|
|
|
|
|
If you're using an OleDbConnection for Oracle, I think you could probably use the OleDbCommand's ExecuteNonQuery() method, issuing a "Create Table ..." statement. Here's an example of a VB.NET console application doing it this way:
Imports System.Data.OleDb
Module Module1
Sub Main()
Const kConnectionString = _
"Provider=MSDAORA.1;User ID=myUser; Password=myPass;Data Source=myServer;"
Dim conn As OleDbConnection
Dim cmd As OleDbCommand
Dim strSql As String
Try
conn = New OleDbConnection(kConnectionString)
conn.Open()
strSql = "Create Table test1(field1 varchar(10))"
cmd = New OleDbCommand(strSql, conn)
cmd.ExecuteNonQuery()
Console.WriteLine("Statement executed.")
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
cmd.Dispose()
conn.Dispose()
End Try
Console.WriteLine("Press Enter...")
Dim strWait As String = Console.ReadLine()
End Sub
End Module
If you're using a different provider (like the OracleClient for example) you'll want to review that provider's documentation for the proper methods to create a table.
|
|
|
|
|
I'm using System.Web.Mail to send e-mails out via smtp using the code below:
Dim Message As System.Web.mail.MailMessage = New System.Web.Mail.MailMessage
Message.To = "someone@outside.com"
Message.From = "me@mycompany.com"
Message.Subject = "test"
Message.Body = "test"
Message.BodyFormat = MailFormat.Text
SmtpMail.SmtpServer = "MY_EX" 'MY_EX = internal exchange server
SmtpMail.Send(Message)
When I send to someone within my company it works like a charm. When I send to an address outside it gives me an error:
Could not access 'CDO.Message' object.
If I change the SmtpMail.SmtpServer to "localhost" it works fine for the reverse, external but not internal addresses. This setup however doesn't create an error but the internal addresses never receive the message, only the external.
Can someone shed some light on what I'm doing wrong. Any suggestions are appreciated.
Thanks,
Kevin
Lost in the vast sea of .NET
|
|
|
|
|
Hi Kevin. Does your internal exchange server have any rules set up to prevent its use as an smtp mail relay?
One thing I've found is helpful when diagnosing the "Could not access 'CDO.Message' object" error is to look at the InnerException property of the Exception object you catch; if one is there, output its message and see if that sheds more light on the problem. If the InnerException exists, also check to see if it has its own InnerException. Keep going until you hit an InnerException = nothing. It may be there are nested exceptions, leading to the outer exception you trap as a 'CDO.Message' error.
|
|
|
|
|
I posted my question on 4 different message boards and received great feedback from all. I like to take the info I received and post the solution if possible so others might benefit if they run into the same problem.
There is a great website that was suggested and I used which gives in depth info on System.WebMail. The site is http://www.systemwebmail.net/ and I would highly recommend it to anyone with questions like the one I had.
Also, one suggestion was to look for the inner exception. I used the following code and found that my inner exception gave me much more info as to what my real problem was. My inner exception was ‘550 Relaying is prohibited’. Relaying needs to be configured correctly on our server. Without the inner exception, I wouldn’t have known this.
Try
SmtpMail.SmtpServer = "EX_SRVR"
SmtpMail.Send(Message)
Catch ex As System.Web.HttpException
strLogMsg = "Error connecting to exchange server: " ex.Message
If ex.InnerException.ToString <> Nothing Then
MsgBox("The following InnerException reported: " & ex.InnerException.ToString)
End If
End Try
Thanks again to all!!
Lost in the vast sea of .NET
|
|
|
|
|
Hi i want to access exchane server5.5 through .NET ,
Does it have some object model
please guide
P.S. PATWAL
|
|
|
|
|
I may be dumb about this, but I have been unable to find the function to raise 10x in VB script!
Anyone know the function I need?
I have looked through the MSDN and not found a reference. I would have expeceted it to be something like:
value = pow(10.0, x)
but pow does not exist.
You can tell I am a c++ coder floundering in the wonderful world of VB!
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
It's much easier than it is in C++. Just use:
result = number ^ exponent
value = 10 ^ x
RageInTheMachine9532
|
|
|
|
|
Thanks for that. I should have known it....
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Does anybody got an clue about how to program Plug-Ins for WinAmp (2.9) in VB !6.0! ??? I really need to do this but I also really don't know how...
Please help,
(¯`·._.·[eRiK]·._.·´¯)
|
|
|
|
|
Anybody know how to design the height of listview columnheaderin vb.net? all i ahd tried is only can be witdth only....hope anyone who met it n solve b4 can tel me soon....
|
|
|
|
|
Does anybody know how to get the cd name, (volume name) and to get the files list in the directory? to pass it in a dataset...
|
|
|
|
|
Hi Julien. Well, you can look at the FileInfo.Name[^] documentation for an example of getting the list of files in a directory. The Dir() function, though a carryover from VB6, is also available in the Microsoft.VisualBasic namespace.
As for the volume name, you could try this (where E:\ is your CD drive):
Dir("E:\", FileAttribute.Volume) or I suppose you could add a reference to the Microsoft Scripting Runtime in your vb.net project and use the FileSystemObject 's GetDrive() method.
|
|
|
|
|
Thanks for your help
Julien
|
|
|
|
|
Hello,
I have spent considerable time trying to find out how to execute a DOS command (something that can be run from the command prompt on a windows machine) from ASP.NET/VB.NET.
I have managed to launch a few processes on the server, but was unable to attach to them - and I had to reboot the server to kill them.
In a nutshell: I use a series of databound pages to locate a device on an intranet. From there I want the user to be able to press a button and either PING the device or TELNET to it. It is suppose to save the user time...instead of having them opening up a DOS window and typing "PING -t mydevice" I want to send the command for them - and show them the results in a standard DOS window.
Please help!
Terry
|
|
|
|
|
You'd have to use VBScript or Javascript code in the webpage that the client uses, not the server. Search for the WshShell object on MSDN.
RageInTheMachine9532
|
|
|
|
|
Thank you Dave - I found the information.
Now, here's the rub...
I need to pass the device name from VB.NET to the script (VBscript or Javascript).
And let me be specific:
I need a button on an .ASPX page that grabs the device name (that was dynamically created from a dataset in VB.NET - take that name and pass it to the WshShell object as a parameter. So I can execute the following on the client machine:
ping -t <device_name>
Okay - I know I am close, but I want to make sure I pull this together correctly.
Thanks again,
Terry
|
|
|
|
|
Dave,
Quick correction:
ping -t device_name
I used greater than and less than on the first post.
Terry
|
|
|
|
|
Hello,
I am using the standard VB.NET and when viewing the Property Pages of my build application (Project / Properties), the Settings button for the Bootstrapper option is grayed out. I do have the option of choosing None, Windows Installer Bootstrapper, and Web Bootstrapper. Is this because I don't have the professional edition?
Vi
|
|
|
|
|
Hello,
Never mind my question. I was being an idiot. The Settings is only activated for the Web Bootstrapping option.
Thanks!
Vi
|
|
|
|
|
When building a setup program, is it better to set conditional statements such as having the setup program install certain components needed in order to run the application. For example, if deploying an application, would it make more sense to have the setup program search the user's computer for required components such as the .NET framework. If the setup program does not detect this, it would automatically install on the user's PC.
Also, what is the standard practice in software development and whether there is a downside to doing this? Or is it best to let the user install the missing components on their own?
Vi
|
|
|
|
|
Hello ,
I'm using VB.NET 7.0 and would like to apply a customized icon to a small application. I was able to apply the icon to the main form, however, I would like to apply it to the application when the user installs it on their computer. Currently, the user sees the default white window when viewing from Windows Explorer. Could someone please direct me to the proper area for this?
Thanks so much!
Vi
|
|
|
|
|
Simple. Open your project, and go to the Project menu. Click on <projectname> Properties at the bottom of the menu. In the left navigation pane click on Build, and you should see on the right 'Application Icon'. Click on the '...' button and you can pick an icon file to use or you can select from the drop down list an icon file that you already have as part of your project.
Click OK and rebuild your project and your done!
RageInTheMachine9532
|
|
|
|
|
Thanks so much Dave. Your instructions were extremely clear. I found it right away.
Vi
|
|
|
|
|
Hi Dave,
I tried exactly as you had instructed and saw the the icon file as added to my project. However, after building the solution and running the setup on my Win 2000 machine, I'm seeing the Paper icon instead (looks like the default). Is there another step or setting to go through?
Vi
|
|
|
|