Click here to Skip to main content
15,892,746 members
Home / Discussions / Database
   

Database

 
QuestionImage problem??? Pin
Small Rat13-May-04 9:24
Small Rat13-May-04 9:24 
AnswerRe: Image problem??? Pin
Hesham Amin13-May-04 21:50
Hesham Amin13-May-04 21:50 
GeneralCross-tab query Pin
Ole12313-May-04 8:14
Ole12313-May-04 8:14 
GeneralRe: Cross-tab query Pin
-Dr_X-13-May-04 10:57
-Dr_X-13-May-04 10:57 
GeneralRe: Cross-tab query Pin
Ole12314-May-04 8:18
Ole12314-May-04 8:18 
GeneralUDF and Table Column Formula Pin
Wackatronic13-May-04 7:06
Wackatronic13-May-04 7:06 
GeneralRe: UDF and Table Column Formula Pin
Grimolfr19-May-04 8:51
Grimolfr19-May-04 8:51 
GeneralData access problem Pin
damoonlight12-May-04 16:27
damoonlight12-May-04 16:27 
In this question I have Form1, myDataAccess class, Customer class.
In Form1 I have ListBox1 and a ButtonFill. Can you show me how do I get the details of customer(Firstname and Lastname) to fill in the ListBox1 by click on the ButtonFill. The 2 classes are coded below. The code in Customer class has some error. I am appreciate if you give me an example code. Thanks

'--------myDataAccess class---------------
Imports System.Data.SqlClient
Public Class myDataAccess
Public Function GetDataSet() As DataSet

Dim connection As SqlConnection
Dim command As New SqlCommand
If command.Connection Is Nothing Then
connection = New SqlConnection("workstation id=WHITE;packet size=4096;integrated security=SSPI;data source=WHITE;persist security info=False;initial catalog=ABC")
connection.Open()
command.Connection = connection
End If
Dim dataset As New DataSet
Dim adapter As New SqlDataAdapter(command)
adapter.Fill(dataset)
adapter.Dispose()

If Not connection Is Nothing Then
connection.Close()
End If
Return dataset
End Function

End Class
-----------------------------------
Imports System.Data.SqlClient
Public Class CustomerClass
Inherits myDataAccess
Public Function GetCustomerByname(ByVal Firstname As String, ByVal Lastname As String) As DataSet

Dim myQuery As String = "select * from CustomerTable"
GetDataSet()
Dim dataset As New DataSet
Dim adapter As New SqlDataAdapter
adapter.SelectCommand = New SqlCommand(myQuery)
adapter.Fill(dataset, "CustomerTable")
Return dataset

End Function
End Class
-----------------------------------

GeneralProblem in finding sum of Columns in a Table Pin
Touseef Afzal12-May-04 12:09
Touseef Afzal12-May-04 12:09 
GeneralRe: Problem in finding sum of Columns in a Table Pin
Edbert P12-May-04 12:45
Edbert P12-May-04 12:45 
GeneralRe: Problem in finding sum of Columns in a Table Pin
Touseef Afzal12-May-04 13:08
Touseef Afzal12-May-04 13:08 
GeneralDataGrid and SQLDataReader Pin
Xaneb12-May-04 9:16
Xaneb12-May-04 9:16 
GeneralRe: DataGrid and SQLDataReader Pin
-Dr_X-12-May-04 16:36
-Dr_X-12-May-04 16:36 
Generalcheck Box and sqlDataReader Pin
Xaneb13-May-04 0:59
Xaneb13-May-04 0:59 
GeneralRe: check Box and sqlDataReader Pin
-Dr_X-13-May-04 11:05
-Dr_X-13-May-04 11:05 
GeneralDetect new record entered/updated in MS SQL Pin
Vu Truong11-May-04 17:08
Vu Truong11-May-04 17:08 
GeneralRe: Detect new record entered/updated in MS SQL Pin
Ian Darling11-May-04 23:24
Ian Darling11-May-04 23:24 
GeneralRe: Detect new record entered/updated in MS SQL Pin
cmk13-May-04 10:53
cmk13-May-04 10:53 
GeneralcommandString Problem Pin
Anonymous11-May-04 12:52
Anonymous11-May-04 12:52 
GeneralRe: commandString Problem Pin
Edbert P11-May-04 16:49
Edbert P11-May-04 16:49 
GeneralRe: commandString Problem Pin
Aryadip12-May-04 0:09
Aryadip12-May-04 0:09 
GeneralADO UPDATE Problem Pin
petesfish11-May-04 12:31
petesfish11-May-04 12:31 
GeneralRe: ADO UPDATE Problem Pin
WoutL11-May-04 22:56
WoutL11-May-04 22:56 
GeneralRe: ADO UPDATE Problem Pin
petesfish12-May-04 6:27
petesfish12-May-04 6:27 
QuestionHow to get transformation result in DTS Pin
KSEI11-May-04 0:27
KSEI11-May-04 0:27 

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.