This is a migrated thread and some comments may be shown as answers.

Web Services and datasets

1 Answer 88 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paul
Top achievements
Rank 1
Paul asked on 14 May 2009, 12:52 PM
Hi,
    I currently have a webservice that my applications talk to, to get data from the database. See below.

How would I implement this using open access? I have already created a class library that reversed mapped my database and added that as a reference to my webservice. I have also enabled open access on my webservice and have a ObjectScopeProvider1 class.

How would I get this data and still return as dataset.VB or C# example would ok.

 

Public Function Get_Application_FolderPath() As DataSet

 

 

Dim ds As New DataSet

 

 

Using conn As New MySqlConnection(MySQLDBString)

 

 

' conn.ConnectionString =

 

 

Dim cmd As New MySqlCommand("Select * from applicationFolderPath", conn)

 

cmd.CommandType = CommandType.Text

 

'cmd.Parameters.Add("UserName", UserName)

 

 

Dim da As New MySqlDataAdapter(cmd)

 

conn.Open()

ds.Namespace =

"FolderPath"

 

ds.Prefix =

"Folders"

 

da.Fill(ds,

"Folders")

 

conn.Close()

 

End Using

 

 

Return ds

 

 

End Function

 

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 15 May 2009, 08:44 AM
Hello Paul,

OpenAccess has its own disconnected API and you do not need to use DataSets. You should use the ObjectContainer class instead. It has the same API as the ObjectScope - you can create, modify and delete objects but without the need of a constant connection to the database. A ChangeSet class is used for filling and extracting data from the container. The class is serializable and can be used for transmitting the data through the service. For more details please take a look at this example.

Kind regards,
Alexander
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Getting Started
Asked by
Paul
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or