Results 1 to 8 of 8

Thread: updating code

Hybrid View

  1. #1
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: updating code

    When you get rid of all the late binding the method is rather simple. It takes a DataSet and a String containing an SQL query, then populates a DataTable in the DataSet and returns a new DataView of that table. I'd suggest you write a method from scratch that does that.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  2. #2

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    4

    Re: updating code

    This is what i have come up with. It shows no errors in VS but i have not tested it in tha actual ap yet. does this look correct?

    Code:
    Public Function bindthissql_SQL(ByVal fds As Object, ByVal fsql As Object) As Object
                Dim MyAdapter As New SqlDataAdapter(StringType.FromObject(fsql), Me.dbconn3)
                MyAdapter.Fill(DirectCast(fds, DataSet), "Thedata")
                Return New DataView(DirectCast(LateBinding.LateGet(fds, Nothing, "Tables", New Object() { "Thedata" }, Nothing, Nothing), DataTable))
            End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width