Click here to Skip to main content
16,003,224 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Question.exe update Pin
padmanabhan N12-Jul-10 21:57
padmanabhan N12-Jul-10 21:57 
Answer[Repost] Re: .exe update Pin
Peace ON12-Jul-10 22:23
Peace ON12-Jul-10 22:23 
AnswerCross post Pin
Pete O'Hanlon12-Jul-10 22:24
mvePete O'Hanlon12-Jul-10 22:24 
QuestionRecords do not show Pin
akosidandan12-Jul-10 20:46
akosidandan12-Jul-10 20:46 
AnswerRe: Records do not show Pin
Peace ON12-Jul-10 22:46
Peace ON12-Jul-10 22:46 
GeneralRe: Records do not show Pin
akosidandan12-Jul-10 23:19
akosidandan12-Jul-10 23:19 
AnswerRe: Records do not show Pin
Peace ON12-Jul-10 23:26
Peace ON12-Jul-10 23:26 
GeneralRe: Records do not show Pin
akosidandan12-Jul-10 23:42
akosidandan12-Jul-10 23:42 
Hello,

Thank, I try to study it Smile | :)

I have some additional question's if you dont mind.
I notice that when I edit the database record and add data on it,
it can show the data that I have add via editing but when
I add data into the database using the wizard or form the records
seems to be dissapear everytime I change the startup form.
(info: form1 - the form that I use to connect via wizard
form2 - form I use via coding connection )

I'm so confused, I can add data but when everytime I change startup form
the records I have added seems gone Confused | :confused: ,
also everytime I add new records it just overwrite and it doesn't add new row Frown | :(

Below here is my code again :
Imports System.Data.SqlClient
Public Class Form2

    Dim con As New SqlConnection

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            con.ConnectionString = "Data Source=.\SQLEXPRESS;" + _
                                    "AttachDbFilename=|DataDirectory|\Database1.mdf;" + _
                                    "Integrated Security=True;User Instance=True"
            con.Open()
            con.Close()

            Dim da As New SqlDataAdapter
            Dim dt As New DataTable
            Dim ds As New DataSet

            ds.Tables.Add(dt)
            con.Open()
            da = New SqlDataAdapter("SELECT * FROM phoneBookTable", con)
            da.Fill(dt)
            con.Close()


            Dim newRows As DataRow = dt.NewRow
            With newRows
                .Item(0) = "2"
            End With
            dt.Rows.Add(newRows)

            con.Open()
            Dim cb As New SqlCommandBuilder(da)
            da.Update(dt)
            con.Close()

            Dim newRows2 As DataRow = dt.NewRow
            With newRows2
                .Item(0) = "3"
            End With
            dt.Rows.Add(newRows2)

            con.Open()
            cb = New SqlCommandBuilder(da)
            da.Update(dt)
            con.Close()

            DataGridView1.DataSource = dt.DefaultView

        Catch ex As Exception
            MsgBox(ex.ToString)
            con.Close()
        End Try

       

    End Sub
End Class



thanks again,
Dan
AnswerRe: Records do not show Pin
Peace ON16-Jul-10 3:02
Peace ON16-Jul-10 3:02 
GeneralRe: Records do not show Pin
akosidandan16-Jul-10 3:07
akosidandan16-Jul-10 3:07 
GeneralRe: Records do not show Pin
Peace ON16-Jul-10 3:11
Peace ON16-Jul-10 3:11 
GeneralRe: Records do not show Pin
akosidandan16-Jul-10 3:14
akosidandan16-Jul-10 3:14 
GeneralRe: Records do not show Pin
Peace ON16-Jul-10 3:16
Peace ON16-Jul-10 3:16 
QuestionMultiple web site hosting in IIS having multiple domain names with static ip Pin
Vinay Varghese11-Jul-10 0:05
Vinay Varghese11-Jul-10 0:05 
AnswerRe: Multiple web site hosting in IIS having multiple domain names with static ip Pin
T M Gray13-Jul-10 8:43
T M Gray13-Jul-10 8:43 
GeneralRe: Multiple web site hosting in IIS having multiple domain names with static ip Pin
Vinay Varghese13-Jul-10 12:36
Vinay Varghese13-Jul-10 12:36 
GeneralRe: Multiple web site hosting in IIS having multiple domain names with static ip Pin
T M Gray14-Jul-10 9:37
T M Gray14-Jul-10 9:37 
GeneralRe: Multiple web site hosting in IIS having multiple domain names with static ip Pin
Vinay Varghese21-Jul-10 19:24
Vinay Varghese21-Jul-10 19:24 
Questionproblem in implementing validations in dynamically generated textboxes in Desktop vb.net application Pin
Amit Spadez9-Jul-10 2:04
professionalAmit Spadez9-Jul-10 2:04 
AnswerRe: problem in implementing validations in dynamically generated textboxes in Desktop vb.net application Pin
Eddy Vluggen10-Jul-10 23:55
professionalEddy Vluggen10-Jul-10 23:55 
QuestionCreating Triggers Using Managed Code in SQL Server 2005 Pin
brian0048-Jul-10 23:11
brian0048-Jul-10 23:11 
QuestionDecompression is not producing actual data Pin
ameem858-Jul-10 20:30
ameem858-Jul-10 20:30 
AnswerRe: Decompression is not producing actual data Pin
Luc Pattyn8-Jul-10 23:44
sitebuilderLuc Pattyn8-Jul-10 23:44 
QuestionHow to deliver our Core class library Pin
cullyk7-Jul-10 21:17
cullyk7-Jul-10 21:17 
AnswerRe: How to deliver our Core class library Pin
Ennis Ray Lynch, Jr.8-Jul-10 6:53
Ennis Ray Lynch, Jr.8-Jul-10 6:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.