1. Try adding a try catch statement in your code in order to get all possible errors. (also try posting the function that runs the sql query in order for us to help you- maybe that function rolls back)
  2. how are you trying to see the database. through your program or directly from the database server. if you are using the server you know that you should refresh the table every time you insert or update something for that to be displayed.
  3. if you have two databases and you insert in one of the and the look in the other one of course the data won't be there because you have inserted them to the other database.

propably the dates arenot in the correct format. try using sql parameters it will help you alot

i can't explain why by when i change the resolution of the pc images appear bigger.

have you checked the screen resolution of the other pcs?

If understand correctly you need to identify if 'abc' is part of the inserted string.
this can be done be using the existing functions of vb.net like this

Dim SearchString as string ="abc"
Dim userstring As string= textBox1.Text

If userstring.contains(SearchString) then
messagebox.show("String Found")
messagebox.show("String not Found")

sorry i answered in a hurry! didn't notice the different name on the post. although i did ask what's wrong with the new code cause it seems fine.

Josef01 on the first code you posted you need set the parameter @id in the following query. that is why you get the error "No value given for one or more required parameters."

Dim sqlstring As String = "Delete from sample where id =@id"
somewhere you need to add what @id is.

use this command
cmd.addparameterwithvalue('@id',[the selected row ID])

Oh you changed it! what's is the problem with this code?

' Create a new table & add columns.
Dim myDataTable As New DataTable("Users")
myDataTable.Columns.Add("ID", System.Type.GetType("System.Int32"))
myDataTable.Columns.Add("Name", System.Type.GetType("System.String"))
myDataTable.Columns.Add("Surname", System.Type.GetType("System.String"))

    ' Add the new table.

    For Each row As DataGridViewRow In Me.myGrd.Rows

     ' Fill datarow.
        Dim mydRow As DataRow = myDataTable.NewRow()
        mydRow(1) = "ID"
        mydRow(2) = "NAME"
        mydRow(3) = "Surname"



I used a grid you can use what ever you have, such as lists, arrays, other datasets

First of all you are using an sql that need a parameter (@ID) and you don't provide that parameter. you need to tell the db what is that ID that you want to delete.

cmd.addparameterwithvalue('@id',[the selected row ID])

Secondly i would first delete from the Database and from the grid as if deleting from the Database fails you should warn your user and not remove it from the grid.

Thirdly, you should put some error handling whenever you are interacting with the Database (try catch statements) and see whether the deletion was successful.

Lastly, I think that your error messages you show to the user are really long. make your messages to the user simple short and clear (but that just my personal taste)

If you are not going to sort your rows at runtime you can also sort them when you retrieve them from the Database

You should close the tread then

Form2 coding

Private mForm1 As form1
Public Property objForm1 () As Form1
Return mForm1
End Get
Set(ByVal value As Form1 )
mForm1 = value
End Set
End Property

' constructor
Public Sub new( ByVal tempForm1 as Form1)

objForm1= tempForm1

end sub

To use the variables you need you simple use the objForm1 property like this:


Form1 coding

dim Form2Instance as new Form2(me)


in words you create a copy of your form1 and place it as a property to your second form.
this way you don't need to reference form1 to get anything from that form(e.g form1.variable1) and you don't need to pass all 50 variables to form2 one by one.

there is not difference between those two except the fact that one of them is more readable because you used with [] statement

Why you don't just pass the first form as a parameter to the second form. it's much simpler and more "clean" and basically you use the forms as object which is the whole point of OO

Declare a property on form2
Private mForm1 As form1
Public Property objForm1 () As Form1
Return mForm1
End Get
Set(ByVal value As Form1 )
mForm1 = value
End Set
End Property

in your second form's constructor set
Public Sub new( ByVal tempForm1 as Form1)

objForm1= tempForm1

end sub

Just suppress the unwanted sections through the section expert. you can find that when right clicking on the section you want to remove

then i don't know! the only thing im doing different is that i dont use the dataadapter

that is because you add the row before adding the columns
As you can see in my example i first add the columns and then the row

in other words move
under the with statement

Can you provide a bit more code? Like the whole function?

you need to filter your dataview again

just a quick question/ observation
If x is declared as string how did you manage to compare it as integer
e.g:If x = 0 Then

codeorder commented: .very good observation.:) +12


with newrow
.Columns.Add("Name", System.Type.GetType("System.String"))
.Columns.Add("Surname", System.Type.GetType("System.String"))
end with


'Add row to datatable
I haven't test it but it should work

pls try to use plain english because some of us can really ready appreviations and slang words

take your time! i was just curious

did you do it?

i suggest the .contain() and .split() functionality.

if you_string.contains("+") then
dim newArraw() as String

 newArray =you_string.split("+")

 dim sum as decimal
 sum = CDecimal(newArray(0).remove("+")) +CDecimal( newArray(1))


I have not tested this code so it could have some syntax errors in it.
it is just to help you get started.

the logic is like this:
first find the parenthesis -()
get what in them and do the calculation and save it in a temp variable
then find what is outside the parenthesis and do the calculation with the result you got from the parenthesi.

careful to always include the change of not having parenthesis or a specific calculation like - or *

then why you posted the following

1 Day Ago
This post is useful and well-written 0 This post is unclear
Re: vb calculator
I have ask that your post be moved to .Net. I'm sure someone over there will help. This is unfortunately vb4/5/6 forum.

2)yes you can send messages from system to mobile using a GSM device and creating the appropriate functions to use the GSM device.

1) i don't think that is possible, you should try asp.net which i hear is not that different from vb.net( although it is hearsay)

you can save this as a string and then on = break it down and do the calculations. be careful to keep the correct hierarchy of calculations or you results will not make any sence.

ps: i thought this is a vb.net forum

i dont really agree with all the above(although i do agree with some of these)
the only real reason for me to change you naming habits it is to make your code more readable and more understandable by others( for instance your co-workers).
you should use your company's standards- that is why they are there anyway.

to give you a for instance:
we name the buttons with the appreviation btn infront- when ever someone forgot to put btn infront of the name it took me a long time to realise that the control i couldn't locate was just named wrongly(i admit that on rare occation i do forget one or two of those standard cause they are so many)

Also, you collegue shouldn't critisize your work - even if he saw the code and he was right- trashing your co-workers online or not is consider BAD MANNERS!!!

you should ask from your manager some material to see what is used in your company and i bet you will find that he is more of a sloppy coder than you

You can also, create a structure and return an instance of that structure.
the structure can contain as many values as you want of any type