Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6675429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:51:17+00:00 2026-05-26T03:51:17+00:00

I have a data entry Winforms App in VS2010. Along with an Entity Data

  • 0

I have a data entry Winforms App in VS2010. Along with an Entity Data Model (.edmx) that is connected to a SQL Compact Database. In this database I have a table Ticket that I am trying to make an insert into.

On my form, I have all my controls DataBindings property setup and pointing to the correct fields in the database.

I am trying to take the values from the controls on the form and add one non-databound field and save the ticket.

Here is my code:

private void btnSave_Click(object sender, EventArgs e)
    {
                this.TS = new TicketService();
                Ticket t = (Ticket)ticketBindingSource.DataSource;
                t.DateEntered = Datetime.Now;
                TS.SaveTicket(t);
    }

I am getting an error with Converting the TicketBindingSource to the Ticket Object.

Anyone know how to do this conversion?

Thanks

Edit: I am not sure if I was clear enough on my issue, I do not believe this is uncommon. All I am trying to do is take the data from my databound controls, place it into a variable, add a non-databound data (e.g. t.DateEntered = DateTime.Now like in the example above) and then Save the data to the database.

I have done this in VB.Net, but VB.Net does this conversion from the DataSource to the Variable automatically. Here is the VB.Net code:

            Dim t = ticketBindingSource.DataSource
            t.DateEntered = DateTime.Now()
            TicketService.SaveTicket(t)

C# does not do this automatically, it throws an error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:51:17+00:00Added an answer on May 26, 2026 at 3:51 am

    I don’t know what do you want exactly, but this is a very good example:

    Insert, Update and Delete using Entity Framework

    I hope help you.

    Happy code !

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web app in production that is used for typical data entry,retrieval,
I have a data entry web app where the control that has focus is
I have a WinForms data entry form that will have upwards of 1500 questions.
I have a WinForm App(.Net 3.5) that we use in house for data entry...ish,
Suppose that you have a big Data Entry Web Application Like Microsoft CRM ,
We have a number of very old data entry forms that were made in
I have a data entry form in a HTML5 application that users will be
I have a data entry form that has remote validation set up to check
I have an ugly data entry task that needs automation. The problem is that
I'm building a data entry interface and have successfully bound the columns that have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.