Results 1 to 5 of 5

Thread: how to Fill dataset from a view instead of table

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    12

    Question how to Fill dataset from a view instead of table

    Plz tell me how to fill a dataset with a view which exist in sql server instead of table.

    and one more thing is it possble to fetch values from a table if it is locked by oledbtransaction.

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

    Re: how to Fill dataset from a view instead of table

    You simply use the name of the view instead of the name of a table in your SQL statements.
    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

  3. #3
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: how to Fill dataset from a view instead of table

    Not your question, but from experience I will not advice you to use a view as datasource, if the view will return large amounts of data. It can become really slow.
    I once had to write an app that refresh olap cubes from views, and heck it was so slow, and everyone blamed my application. It turns out you need SQL Enterprise to index views for performance boost.
    If you run into that problem too, rather use a stored procedure. At least sql server optimize it for you.
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    12

    Re: how to Fill dataset from a view instead of table

    then how will i fetch value from a particular row as i used to get like
    Dataset.Tables[0].Rows[0][0].ToString()

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

    Re: how to Fill dataset from a view instead of table

    Once you have retrieved the data everything is exactly the same as before.
    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

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