I Have a Problem with Update my SQL Data Base In VB.net Application
each time I use a update or and Add new row Function
the change remain only until I close the From
And When I check with the database there is no update
Like the change is hold on temp thing and not save in the real data base
1)This is my connection
Dim str As String = "Data Source= .\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database1.mdf;Integrated Security=True;User Instance=True"
Data Base type "Service-Base SQL Data"
2)This my Add Function
Sub Add_Info()
Dim Con As New SqlConnection(Str)
Dim sql As String = "insert into Test values (@id , @n, @t)"
Dim com As New SqlCommand(sql, Con)
com.Parameters.Add("@id", SqlDbType.Int).Value = Count() + 1
com.Parameters.Add("@n", SqlDbType.NVarChar).Value = "test"
com.Parameters.Add("@t", SqlDbType.NVarChar).Value = "old1"
Con.Open()
Dim x As Integer = com.ExecuteNonQuery()
Con.Close()
Con.Dispose()
com.Dispose()
com = Nothing
End Sub
I'm Ruining app in VS.
the value of "Copy to output directory" property?
If u mean property of the Data-Base then that is right
it's "Copy always"
If I change it to not copy I got an error msg of "cant access the data"
How can I View the data in Bin and see the data while My app still in the VS environment?