I m using LAN Connection,My system used as remot ,
When i going to run , my system become HANG!!!

i m doing VB.Net Programs , using sql2000 backend

What shoud i do ???

Can u help me......??????????

Recommended Answers

All 3 Replies

What are you trying to do? Reading from MS-SQL using VB.net?

yes , Can you hepl me hoe to creat?

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 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=PRODUCT0;uid=sa;pwd=pisces;database=Testing;Trusted_Connection=yes")
        Else
            Try
                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 : cmd = con.CreateCommand
                    cmd.CommandText = "INSERT INTO Sample(Name,Number) VALUES('" & Trim(txtname.Text) & "','" & Trim(txtnumber.Text) & "')"
                    Int = cmd.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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.