C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Function to get the data in the form of dataview.


Posted Date: 29 Nov 2007    Resource Type: Code Snippets    Category: ADO.NET

Posted By: Jyoti Sharma       Member Level: Gold
Rating:     Points: 7



To get the records in the form of dataview by passing a sql query and the connectionstring.



Public Function GetRecords(ByVal SQL As String, ByVal ConnectionString As String) As DataView
Dim oCon As New OleDbConnection(ConnectionString)
Dim objDataAdapter As New OleDbDataAdapter(SQL, oCon)
Dim objDataSet As New DataSet()
Try
oCon.Open()
objDataAdapter.Fill(objDataSet)
oCon.Close()

Return objDataSet.Tables(0).DefaultView
Catch e As Exception
Throw New Exception(e.Message & vbNewLine & e.Source & ":-GetRecords")
End Try
End Function






Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Dataview  .  Dataset  .  Data  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to add edit data base from form without long query, & asign each field to a control
Previous Resource: Delete a record from the database
Return to Discussion Resource Index
Post New Resource
Category: ADO.NET


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

it support

Contact Us    Privacy Policy    Terms Of Use