Hallo zusammen!
Ich habe eine Funktion erstellt für die Serververbindung und eine zweite Funktion für Dataadapter, Command und dataset.

Code :
1
2
3
4
5
6
7
8
9
10
11
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Function[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] F_01([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] dataSet [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] DataSet, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] connectionString [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], _[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] query [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] DataSet[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] con [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] SqlClient.SqlConnection = GetConnection()[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] adapter [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] SqlClient.SqlDataAdapter()[/SIZE]
[SIZE=2]query = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Select tbl_01 from Logi_01"[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]adapter.SelectCommand = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] SqlClient.SqlCommand(query, con)[/SIZE]
[SIZE=2]adapter.Fill(dataSet)[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Return[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] dataSet[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Using[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Function[/COLOR][/SIZE]
[/COLOR][/SIZE]

Beim Aufruf kommt folgende Fehlermeldung:
Fehler 1 Für den Parameter "connectionString" von "Public Function F_01(dataSet As System.Data.DataSet, connectionString As String, query As String) As System.Data.DataSet" wurde kein Argument angegeben. C:\Dokumente und Einstellungen\Hurek.HUREK-7B83C703B\Eigene Dateien\Visual Studio 2005\Projects\Test_01\Test_01\Form1.vb 73 9 Test_01

Fehler 2 Für den Parameter "dataSet" von "Public Function F_01(dataSet As System.Data.DataSet, connectionString As String, query As String) As System.Data.DataSet" wurde kein Argument angegeben. C:\Dokumente und Einstellungen\Hurek.HUREK-7B83C703B\Eigene Dateien\Visual Studio 2005\Projects\Test_01\Test_01\Form1.vb 73 9 Test_01

Fehler 3 Für den Parameter "query" von "Public Function F_01(dataSet As System.Data.DataSet, connectionString As String, query As String) As System.Data.DataSet" wurde kein Argument angegeben. C:\Dokumente und Einstellungen\Hurek.HUREK-7B83C703B\Eigene Dateien\Visual Studio 2005\Projects\Test_01\Test_01\Form1.vb 73 9 Test_01

Was habe ich Trottel wieder falsch gemacht. Für Hilfe mit einen Stück Code wäre ich dankbar.

Gruß Peter