I have a general VB fax program working fine, however now I would like to connect to a SQL database and get the fax numbers to send out to our customers. What code is missing to connect to the SQL server? I'm leaving the test fax - individual file just for testing purposes. Please don't respond with links, moreover I can do my own google searches!
CODE
Public Class frm1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btntransmitt.Click
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
Dim objFaxServer As New FAXCOMEXLib.FaxServer
Dim objSender As FAXCOMEXLib.FaxSender
Dim JobID As Object
Dim devices As FAXCOMEXLib.FaxDevice
Dim ds As DataSet
Dim NurseryConnection As SqlClient.SqlConnection
Dim OpenCustomer As SqlClient.SqlCommand
[b]'Connect to SQL DB
NurseryConnection = New SqlClient.SqlConnection("server=(server3500\NuserySQL);database=DevNursery Trusted_Connection=yes")[/b]
'open customer table
'Connect to the fax server
objFaxServer.Connect("serverfax")
objFaxDocument.Body = "C:\test.txt"
'Add the recipient with the fax number xxxxxxxx
objFaxDocument.Recipients.Add("1111111", "Todd")
'Submit the document to the connected fax server
'and get back the job ID.
JobID = objFaxDocument.ConnectedSubmit(objFaxServer)
MsgBox("The Job ID is :" & JobID(0))
'Set the cover page type and the path to the cover page
objFaxDocument.CoverPageType = FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptSERVER
'objFaxDocument.CoverPageType.FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptNONE()
objFaxDocument.CoverPage = "generic"
'Provide the cover page note
objFaxDocument.Note = "Availability Sheet "
'Provide the address for the fax receipt
objFaxDocument.ReceiptAddress = ""
'Set the receipt type to email
objFaxDocument.ReceiptType = FAXCOMEXLib.FAX_RECEIPT_TYPE_ENUM.frtMAIL
'Set the receipt type to email
objFaxDocument.ReceiptType = FAXCOMEXLib.FAX_RECEIPT_TYPE_ENUM.frtMSGBOX
Exit Sub
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnclose.Click
Close()
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub frm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class