Hi
I m new to Vb.net. i need to Know anout the ConnectionString Details,.
For eg.

First Name
Last Name
PH Number

Use this 3 datas to save Sql.
plz give me the Coding for this ...

Recommended Answers

All 6 Replies

Show us your effort, Post your code.
And don't hijack other thread please...

Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
Dim constr As String
Dim Sql As String
Dim red As String
Sql = "Select * from Sample"
Dim con As SqlClient.SqlConnection = New SqlClient.SqlConnection("Data Source=QB;uid=sa;Pwd=pisces;persist security info=False;initial catalog=Sample")
MsgBox("Test")
Try
con.Open()
MsgBox("Connection opened successfully.")
constr = "Insert Sample where Name='" & txtname.Text & "' and Number='" & txtnumber.Text & "'"
Dim com As New System.Data.SqlClient.SqlCommand(constr, con)
Finally
con.Close()
End Try
End Sub

put this code on module (my module named koneksi)

'In Module
'Declare outside of class
Imports System.Data
Imports System.Data.SqlClient

Module Koneksi
    Public conn As SqlConnection
    Public Function GetConnect()
        conn = New SqlConnection("server = MyServerName;database = MyDatabaseName;Trusted_Connection = yes")
        Return conn
    End Function
End Module

Thank you....

But .,

I m using LAN Connection,My system used as remot , i tryed this aslo showing error ,
sometime system become HANG

What shoud do ???

Some times my system Hang !!!!

I m using LAN Connection,My system used as remot ,
sometime system become HANG

What shoud do ???

Some times my system Hang !!!!

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.