Click here to Skip to main content
15,897,371 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Hello there!!! need VB.Net assistant. Pin
Member 415614818-Jun-08 14:16
Member 415614818-Jun-08 14:16 
QuestionClear DataGrid sorting Pin
Mohammad Al Hoss18-Jun-08 4:47
Mohammad Al Hoss18-Jun-08 4:47 
AnswerRe: Clear DataGrid sorting Pin
Ashfield18-Jun-08 9:05
Ashfield18-Jun-08 9:05 
GeneralRe: Clear DataGrid sorting Pin
Mohammad Al Hoss18-Jun-08 21:49
Mohammad Al Hoss18-Jun-08 21:49 
GeneralRe: Clear DataGrid sorting Pin
Ashfield18-Jun-08 22:19
Ashfield18-Jun-08 22:19 
GeneralRe: Clear DataGrid sorting Pin
Mohammad Al Hoss18-Jun-08 22:22
Mohammad Al Hoss18-Jun-08 22:22 
GeneralRe: Clear DataGrid sorting Pin
Ashfield18-Jun-08 22:49
Ashfield18-Jun-08 22:49 
QuestionCount records using a wildcard... Pin
CCG318-Jun-08 4:07
CCG318-Jun-08 4:07 
I am working with VB.Net 2005 and I am looking at an Access 2003 mdb. I need to look into a table and see if any records exists that have a value in a certain field based on what is keyed in from a text box...here is what I have so far. I think I am close but when I get to the line "Count2 = CInt(cmd.ExecuteScalar)" I get error..."No value given for one or more required parameters." So I am certainly missing something.

'Check to make sure the Current Department already exisits

Dim Count2 As Integer = 0

Using Connection As New OleDbConnection _

("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Comet 631 Databases\Converted to 2003\C022008.mdb")

Dim cmd As OleDbCommand = New OleDbCommand _

("Select Count(ActAcct) as ExistingRecords From [SHACT] where (@CurrDepart)=?", Connection)

cmd.Parameters.AddWithValue("@CurrDepart", OleDbType.VarChar).Value = Me.txtCurGL.Text.ToString + "%"

Connection.Open()

Count2 = CInt(cmd.ExecuteScalar)

End Using

'if the Current Department doesn't exisit then throw message and exit sub

If Count2 <= 0 Then

MessageBox.Show("The GL Department " & Me.txtCurGL.Text.ToString & " does not exisit.", _

"Copy Department", MessageBoxButtons.OK)

Me.txtCurGL.Focus()

Me.txtCurGL.SelectAll()

Return

End If
AnswerRe: Count records using a wildcard... Pin
Noctris18-Jun-08 5:53
Noctris18-Jun-08 5:53 
GeneralRe: Count records using a wildcard... Pin
CCG318-Jun-08 6:15
CCG318-Jun-08 6:15 
GeneralRe: Count records using a wildcard... Pin
Ashfield18-Jun-08 9:14
Ashfield18-Jun-08 9:14 
GeneralRe: Count records using a wildcard... Pin
CCG318-Jun-08 9:24
CCG318-Jun-08 9:24 
GeneralRe: Count records using a wildcard... Pin
Noctris18-Jun-08 22:33
Noctris18-Jun-08 22:33 
GeneralRe: Count records using a wildcard... Pin
CCG319-Jun-08 2:09
CCG319-Jun-08 2:09 
QuestionXML help please - never worked with this structure before Pin
penguin500018-Jun-08 3:50
penguin500018-Jun-08 3:50 
AnswerRe: XML help please - never worked with this structure before Pin
Johan Hakkesteegt19-Jun-08 0:07
Johan Hakkesteegt19-Jun-08 0:07 
QuestionData Access Layer Pin
Fahim A18-Jun-08 3:32
Fahim A18-Jun-08 3:32 
AnswerRe: Data Access Layer Pin
Mohammad Al Hoss18-Jun-08 4:53
Mohammad Al Hoss18-Jun-08 4:53 
AnswerRe: Data Access Layer Pin
Fahim A19-Jun-08 12:58
Fahim A19-Jun-08 12:58 
QuestionDatagridview columns Pin
Jay Royall18-Jun-08 2:26
Jay Royall18-Jun-08 2:26 
AnswerRe: Datagridview columns Pin
Johan Hakkesteegt18-Jun-08 23:55
Johan Hakkesteegt18-Jun-08 23:55 
GeneralRe: Datagridview columns Pin
Jay Royall19-Jun-08 1:32
Jay Royall19-Jun-08 1:32 
Questionhow to read file Pin
Ebube18-Jun-08 2:21
Ebube18-Jun-08 2:21 
AnswerRe: how to read file Pin
Noctris18-Jun-08 3:11
Noctris18-Jun-08 3:11 
AnswerRe: how to read file Pin
Ashfield18-Jun-08 3:39
Ashfield18-Jun-08 3:39 

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.