|
HuuuuuuuuuuReeeeeeeeeeeee
It' working i think this is my very stupid mistake , any way thanks very much for guiding me
thanks
|
|
|
|
|
Can you save a range of items in a listbox as a datatype, like a collection for adding to an Access Database??
If not then how do you loop thorough the listbox adding each one to a seperate column in an Access table?
Thanks
|
|
|
|
|
I belive what is more easy if you first save the values of listbox in an array, then send these datas to database by a cicle filling a recorset to update or with sql instructions.
Greetings from Mexico
-----------------------
Cuando salga el sol, no estare aqui...
|
|
|
|
|
Thanks, but im new to VB, can someone show me the code to do this?
|
|
|
|
|
I want to add a sound when a form loads, can I simply add the sound as a resource and then just make a statement like my.resource...blaablaablaa .play, or is it a lot more complicated than that?
Also, can i use mp3 or am i stuck with wav?
Cheers
|
|
|
|
|
Just use: My.Computer.Audio.Play(My.Resources.(YourFile), AudioPlayMode.WaitToComplete) .
harveyhanson wrote:
Also, can i use mp3 or am i stuck with wav?
Unless you want to embed Windows Media Player into your app (which would be a pain), you can only use .wav files. Hope this helps.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
can anyone help me to write a sample update query to update some text and interger fields in my database..i am using sql server 2000...
please send me a sample one that works.. so i can test it and modify it to use in my project...thanks.. having problem writing mine..
Nab
|
|
|
|
|
Why dont you post what you have so far and we can point you in the correct direction.
CleAkO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
its generated by webmatrix.. but its just not updating a field that is already in the table which has a string value...don't know why..
Dim queryString As String = "UPDATE [R_Application] SET [Fname]=@Fname, [Mname]=@Mname, [Lname]=@Lname WHERE (" & _
"[R_Application].[AppId] = @AppId)"
if the field was null then it works..but if some value exist..it doesn't update...
Nab
|
|
|
|
|
Is this the same query it always uses?
CleAkO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
yes same query..what wrong with it?... just do one and send it to me..let me try it
Nab
|
|
|
|
|
You have to show more of your code.
What you describe doesn't make sense if one only looks at the SQL query. An update query doesn't care if the value in the field is null or not, it updates the field in either case.
---
single minded; short sighted; long gone;
|
|
|
|
|
Ok..this is the exact query i am using....
Function testUpdate(ByVal appId As Integer, ByVal fname As String, ByVal lname As String) As Integer
Dim connectionString As String = "server='(local)'; trusted_connection=true; database='TESTDBfhms'"
Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "UPDATE [R_Application] SET [Fname]=@Fname, [Lname]=@Lname WHERE ([R_Application]."& _
"[AppId] = @AppId)"
Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dbParam_appId As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_appId.ParameterName = "@AppId"
dbParam_appId.Value = appId
dbParam_appId.DbType = System.Data.DbType.Int32
dbCommand.Parameters.Add(dbParam_appId)
Dim dbParam_fname As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_fname.ParameterName = "@Fname"
dbParam_fname.Value = fname
dbParam_fname.DbType = System.Data.DbType.[String]
dbCommand.Parameters.Add(dbParam_fname)
Dim dbParam_lname As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_lname.ParameterName = "@Lname"
dbParam_lname.Value = lname
dbParam_lname.DbType = System.Data.DbType.[String]
dbCommand.Parameters.Add(dbParam_lname)
Dim rowsAffected As Integer = 0
dbConnection.Open
Try
rowsAffected = dbCommand.ExecuteNonQuery
Finally
dbConnection.Close
End Try
Return rowsAffected
End Function
Nab
|
|
|
|
|
There is nothing wrong with that code.
Debug the code and watch where you get the values from, as I suggested in the other thread.
---
single minded; short sighted; long gone;
|
|
|
|
|
I cant seem to remember how to record keystrokes. Basically i need to use the keystroke value in an IF Statement to say,
if back or delete were pressed then
end if
thanks in advance
Karma
|
|
|
|
|
The windows form as a KeyPress event that you can look at to retrieve the keystroke.
CleAkO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
Here is some code that should work for you...
Private Sub yourtextbox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles yourtextbox.KeyDown
'Only allow some control keys
If e.KeyValue = Keys.Delete OrElse e.KeyValue = Keys.Back Then
'good key press
Else
e.Handled = True
End If
End Sub
Hope that helps.
Ben
|
|
|
|
|
use the key down event handler as below
Private Sub txtTendered_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtTendered.KeyDown
If e.KeyCode = Keys.delete Then
do something here
elseif e.keycode = keys.enter then
do something else
end if
end sub
hope this helps
Nab
|
|
|
|
|
hi there i hope you can help me to find a code for this program..i need it asap cause this is my exam...i hope my mgrespond d2...thankz..uumwaaaaaaaaaahh
at last im officially a member nah?!watz up guyz!
|
|
|
|
|
This same question is posted weekly, just search for it.
CleAkO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
Let me get this straight. You want us to find prewritten code for you, I'm assuming it's a quiz program, so you can pass an exam?? Correct?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i need it asap cause this is my exam
He says so right there.
CleAkO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
You can't fault his honesty.
|
|
|
|
|
I just wanted to see if he'd cinch the rope around his neck tight enough, in light of point number 9, here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: I just wanted to see if he'd cinch the rope around his neck tight enough, in light of point number 9
Oh, yes....
|
|
|
|