Kevin
<WebMethod()> _ Public Function SampleMethod() As String '-- Determine if the connection has been established If MicroFour.StrataFrame.Data.DataBasics.DataSources.Count = 0 Then DataBasics.DataSources.Add(New SqlDataSourceItem("", "MyConnectionSTring")) End If
Return "Whatever" End Function
- or -
Much Better SolutionYou can add a global.asax to your webservice project and add the code once in the Application_Startup method and never worry about it...
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) DataBasics.DataSources.Add(New SqlDataSourceItem("", "MyConnectionSTring"))End Sub
You can define your connection strings manually by adding the following code:
'------------------------------------
Let me know if this answers your question.
StrataFrame can definitly be used within web services and has functionality to serialize and de-serialize business objects. We have several users that have create webservices projects with StrataFrame. As for whether it is a good fit for your project, I don't know. It depends on what you are trying to accomplish. If you want your WinForms and WebForms application to be a central point of communication, then this might be a way to go. The only time you really need to do this (for WinForms) is when you are going to have a connection at a remote location and will not have a VPN between to two locations. Otherwise, it is usually better to just point the WinForms application to the remote location with your connection string.
BTW, I haven't forgotten about you and your Access View issue. We are working on getting out the 1.4 build, so I appologize for any delays.
I have a BO project to ecapsulate all the data access.
I'd like to now create a webservice project to utilize the BOs I created (which will be consumed by both web and win forms).
Would webservices be a good fit here? I haven't played with webservices much, so I am beginning my google quest, but wanted to see if anyone here has implemented this and would be willing to share their ideas.
Thanks!