C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » Windows »

SQL statement not filling table for time period of "24/10/2009" to "30/10/2009"


Posted Date: 06 Nov 2009      Posted By: Dipendra Singh      Member Level: Bronze     Points: 1   Responses: 1



Hi,

I am facing a problem while filling a datatable with a query . If I am individually running a query in oracle (Toad environment) its running fine.
But when in a windows service, If I am trying to fill datable its not working.

But for other Sql statement code is working fine.

Below is the piece of code for filling datable


Protected Function ExecuteQuery(ByVal sql As String) As DataTable
Dim conn As IDbConnection = Nothing
Dim cmd As OracleCommand = Nothing
Dim da As OracleDataAdapter = Nothing
Dim table As DataTable = Nothing

Try
cmd = New OracleCommand
cmd.CommandText = sql

If Me.conn Is Nothing Then
DAO.OpenDatabase(Me.db, conn)
cmd.Connection = CType(conn, OracleConnection)
Else
cmd.Connection = Me.conn
End If

table = New DataTable
da = New OracleDataAdapter(cmd)
da.SafeMapping.Add("*", GetType(String))
da.Fill(table)

Catch ex As Exception
Throw ex
Finally
If Not da Is Nothing Then
da.Dispose()
End If
If Not cmd Is Nothing Then
cmd.Dispose()
End If
End Try

Return table
End Function





Responses

Author: Dipendra Singh    06 Nov 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

I attached the SQL for your review.

Thank you,
Dipendra



SQL.txt
Post Reply
You must Sign In to post a response.
Next : Close One Form and Open New Form
Previous : Adding datagridviewimagecouumn dynamically
Return to Discussion Forum
Post New Message
Category: Windows

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use