Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

entity framework model SaveChanges() doesn't save to sqlserver table

$
0
0

Hi all

I am using this code to save a record into database table called 'Enterprise'

Dim Entdb As New Fajr_POSEntities
Dim ent As New Enterprise

        With ent
            .Ent_Name = txtEnt_Name.Text
            .Ent_Activity = txtEnt_Activity.Text
            .City = txtCity.Text
            .Address = txtAddress.Text
            .phone_1 = txtPhone_1.Text
            .phone_2 = txtPhone_2.Text
            .mobile = txtMobile.Text
            .Email = txtEmail.Text
        End With

        Entdb.Enterprises.Add(ent)
        Entdb.SaveChanges()

        MsgBox("Record is Saved")

When I run this code, it seams that every thing works fine. But when I go to the database table and select (Show Table Data), it doesn't show the inserted record.

I got tired with this small big problem.

plz help


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>