Click here to Skip to main content
16,017,907 members
Home / Discussions / C#
   

C#

 
QuestionConnect SQL Server 2005 from VS.Net 2005 Pin
Banjo Ayorinde22-Aug-07 1:27
Banjo Ayorinde22-Aug-07 1:27 
AnswerRe: Connect SQL Server 2005 from VS.Net 2005 Pin
Giorgi Dalakishvili22-Aug-07 1:42
mentorGiorgi Dalakishvili22-Aug-07 1:42 
QuestionConnecting SQL Server 2005 from VS.Net 2005 Pin
Banjo Ayorinde22-Aug-07 1:02
Banjo Ayorinde22-Aug-07 1:02 
AnswerRe: Connecting SQL Server 2005 from VS.Net 2005 Pin
Rocky#22-Aug-07 1:06
Rocky#22-Aug-07 1:06 
Questionhelp on project Pin
himanshu p taunk22-Aug-07 0:47
himanshu p taunk22-Aug-07 0:47 
AnswerRe: help on project Pin
Christian Graus22-Aug-07 0:55
protectorChristian Graus22-Aug-07 0:55 
AnswerRe: help on project Pin
J4amieC22-Aug-07 1:01
J4amieC22-Aug-07 1:01 
GeneralRe: help on project Pin
himanshu p taunk22-Aug-07 1:11
himanshu p taunk22-Aug-07 1:11 
my mistake

sorry


most of my program takes too much time to connect a database (SQL Express /MS Access) making my application to response slow.

i access my database using a class

where i have declare my statements

(currently i am working on vb Project)
this is the code i usto access to database

do u find any problem with it
''''''
Imports System
Imports System.Data
Imports System.Data.OleDb
Public Class dbtask
Public Sub New()

End Sub

Public ReadOnly Property Connection() As OleDbConnection
Get
Try
Return New OleDbConnection(Configuration.ConfigurationManager.AppSettings(0).ToString())
Catch ex As Exception
Throw New Exception("OleDbConnection : " & ex.Message)
End Try
End Get
End Property

Public Function ExecuteCommand(ByVal statement As String) As DataTable
Try
Dim adp As New OleDbDataAdapter(statement, Connection())
Dim ds As New DataSet
ds.Clear()
adp.Fill(ds)
' MsgBox("-->" & ds.Tables.Count)
Return ds.Tables(0)
Catch ex As Exception
Connection.Close()
'Throw New Exception("Oledb Execute Command : " & ex.Message)
Return Nothing
End Try

End Function

Public Sub ExecuteNonCommand(ByVal statement As String)
Dim cmd As New OleDbCommand(statement, Connection())
Try
cmd.Connection.Open()
cmd.ExecuteNonQuery()
cmd.Connection.Close()
Catch ex As Exception
cmd.Connection.Close()
Throw New Exception("Oledb Execute Non Command : " & ex.Message)
End Try
End Sub
End Class



himanshu p.taunk

GeneralRe: help on project Pin
Rocky#22-Aug-07 1:17
Rocky#22-Aug-07 1:17 
AnswerRe: help on project Pin
Guffa22-Aug-07 2:52
Guffa22-Aug-07 2:52 
GeneralRe: help on project Pin
Brady Kelly22-Aug-07 3:31
Brady Kelly22-Aug-07 3:31 
AnswerRe: help on project Pin
Guffa23-Aug-07 0:22
Guffa23-Aug-07 0:22 
GeneralRe: help on project Pin
himanshu p taunk23-Aug-07 7:11
himanshu p taunk23-Aug-07 7:11 
QuestionConnecting SQLExpress codes Pin
Banjo Ayorinde22-Aug-07 0:45
Banjo Ayorinde22-Aug-07 0:45 
AnswerRe: Connecting SQLExpress codes Pin
himanshu p taunk22-Aug-07 0:50
himanshu p taunk22-Aug-07 0:50 
QuestionHow to set a reminder in c# Pin
Vivekanandan22-Aug-07 0:38
Vivekanandan22-Aug-07 0:38 
AnswerRe: How to set a reminder in c# Pin
Christian Graus22-Aug-07 0:57
protectorChristian Graus22-Aug-07 0:57 
GeneralRe: How to set a reminder in c# Pin
led mike22-Aug-07 4:33
led mike22-Aug-07 4:33 
Questionchanging color of disabled controls Pin
cignox122-Aug-07 0:34
cignox122-Aug-07 0:34 
AnswerRe: changing color of disabled controls Pin
JoeSharp22-Aug-07 0:57
JoeSharp22-Aug-07 0:57 
GeneralRe: changing color of disabled controls Pin
cignox122-Aug-07 1:30
cignox122-Aug-07 1:30 
GeneralRe: changing color of disabled controls Pin
Martin#22-Aug-07 1:34
Martin#22-Aug-07 1:34 
QuestionAccess webmail ? (like hotmail, etc) Pin
finskiy22-Aug-07 0:33
finskiy22-Aug-07 0:33 
AnswerRe: Access webmail ? (like hotmail, etc) Pin
Christian Graus22-Aug-07 1:00
protectorChristian Graus22-Aug-07 1:00 
AnswerRe: Access webmail ? (like hotmail, etc) Pin
SpiveyC#22-Aug-07 2:14
SpiveyC#22-Aug-07 2:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.