Showing posts with label purchase. Show all posts
Showing posts with label purchase. Show all posts

Sunday, March 11, 2012

connecting to database

Ilya Tumanov wrote:

Yes, but it makes no sense. To accomplish that you would have to purchase SQL 2000/2005 and pay CALs per device (or per CPU license). If that’s acceptable, simply get rid of Access and use much more powerful SQL you've paid for.

Alternative solution is to use Web Service to talk to Access database. Create couple WEB methods to talk to access and call them from device. Something like this should do:

DataSet GetAccessData(String command, …)

{

// Connect to Access DB here, execute command and populate data set with returned data.

return dataSet;

}

Bool UpdateAccessData(DataSet dataSet, … )

{

// Connect to Access DB here and update DB with data from Data Set.

return success;

}


How would I connect to an access database through a web service? Or where would I find information about this?
[code]
Dim FHDB As New OleDb.OleDbConnection("connstr")
Dim daFoodDonor As New OleDb.OleDbDataAdapter("select * from FoodDonations", FHDB)
[/code]
Actually I think i have this figured out but now i have a new preoblem that does not makes sense to me.
In my project I added the webservice and make a call to is
[code]
Dim upload As New Access.Access()
upload.UpdateAccessData(DonorChanges, AgencyChanges)
[/code]
but it tells me that DeviceApplication1.FHHDBDataSet.DonorInformationDataTable cannot be converted to type DeviceApplication1.Access.FHHDBDataSet.DonorInformationDataTable
I dont understand why not they are both the same type, only difference is the '.Access' in there.Sounds like this is a access db issue. You probably want o ask around in access forum. Thx,

Friday, February 10, 2012

connect to SQL db on website ? (+ send email)

1. If I wanted to send email based on polling of data held in an SQL db
hosted on a website, what would be the best way to do it?
(i.e purchase a dedicated server, write and install a service and get the
service to send to ISP's SMTP server ?)
2. If I wanted to connect to an SQL DB hosted on a website what would be the
best way ?
(open port and connect over SSL ?)
Thanks for any information
ScottScott,
Here is a simple function I wrote to send email in VB.NET. You were not
specific to any programming language.
Private Sub SendEmail(ByVal Path As String, Optional ByVal Body As
String = "", Optional ByVal Too As String = "default@.default.com")
Dim SendMessage As New SmtpClient
Dim Message As MailMessage = New
MailMessage("from@.somewhere.com", Too, "Foo", Body)
Dim App As Attachment
If Path.Length > 0 And File.Exists(Path) Then
App = New Attachment(Path)
Message.Attachments.Add(App)
End If
SendMessage.Host = "" 'ServerName or IP Address of SMTP Server
goes here.
SendMessage.Send(Message)
End Sub
This function was created in VS 2005 using the .net framework 2.0

connect to SQL db on website ? (+ send email)

1. If I wanted to send email based on polling of data held in an SQL db
hosted on a website, what would be the best way to do it?
(i.e purchase a dedicated server, write and install a service and get the
service to send to ISP's SMTP server ?)
2. If I wanted to connect to an SQL DB hosted on a website what would be the
best way ?
(open port and connect over SSL ?)
Thanks for any information
ScottScott,
Here is a simple function I wrote to send email in VB.NET. You were not
specific to any programming language.
Private Sub SendEmail(ByVal Path As String, Optional ByVal Body As
String = "", Optional ByVal Too As String = "default@.default.com")
Dim SendMessage As New SmtpClient
Dim Message As MailMessage = New
MailMessage("from@.somewhere.com", Too, "Foo", Body)
Dim App As Attachment
If Path.Length > 0 And File.Exists(Path) Then
App = New Attachment(Path)
Message.Attachments.Add(App)
End If
SendMessage.Host = "" 'ServerName or IP Address of SMTP Server
goes here.
SendMessage.Send(Message)
End Sub
This function was created in VS 2005 using the .net framework 2.0