prasannapower 0 Newbie Poster

I m useing this below Cods, But its not working .....

Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
Dim con As System.Data.SqlClient.SqlConnection
Dim cmd As New System.Data.SqlClient.SqlCommand
Dim cmdd As New System.Data.SqlClient.SqlCommand
Dim da As New System.Data.SqlClient.SqlDataAdapter
Dim ds As New DataSet
Dim dt As New DataTable
Dim Int As Integer
If txtname.Text = "" Or txtnumber.Text = "" Then
MsgBox("Name and Number is not completed", MsgBoxStyle.OKOnly)
ElseIf MsgBox("Are you sure to save the Name : " & txtname.Text & " ?", MsgBoxStyle.OKCancel, "Input confirm") = MsgBoxResult.Cancel Then
con = New System.Data.SqlClient.SqlConnection("server=localhost;uid=sa;pwd=pisces;database=Testing;Trusted_Connection=yes")
Else
Try
con = New System.Data.SqlClient.SqlConnection("server=localhost;uid=sa;pwd=pisces;database=Testing;Trusted_Connection = yes")
con.Open()
cmd = con.CreateCommand
cmd.CommandText = "SELECT * FROM Name WHERE Name='" & Trim(txtname.Text) & " ' "
da.SelectCommand = cmd
da.Fill(ds, "Testing")
dt = ds.Tables("Name")
If (dt.Rows.Count > 0) Then
MsgBox(" Name " & Trim(txtname.Text) & " already in database", MsgBoxStyle.OKOnly, "Message :")
Else : cmdd = con.CreateCommand
cmdd.CommandText = "INSERT INTO Sample(Name,Number) VALUES('" & Trim(txtname.Text) & "','" & Trim(txtnumber.Text) & "')"
Int = cmdd.ExecuteReader.RecordsAffected()
If Int > 0 Then
MsgBox("Name " & Trim(txtname.Text) & " succesfully to added", MsgBoxStyle.OKOnly, "Message :")
Else
MsgBox("Name " & Trim(txtname.Text) & " Failure to added", MsgBoxStyle.OKOnly, "Message :")
End If
con.Close()
End If
Catch ex As Exception
MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Connection Error !!")
End Try
End If
End Sub

vb.net2003
Sqlserver2000
Database Name:"Testing"
TableName:"Name"

Check it and help me .... :-)