Synchronizing dataset (.xsd file ?) to mySQL - c#

With Microsoft Visual Studio 2010 and MySQL 5.2.40,
How is it possible to get visual c# to update itself after changes have been made in MySQL?
I simply added a column to a table in MySQL ( using the edit Table in the contextual menu ... the Alter Table is not available to me... could that be the problem?) and then I could not get visual studio to update it's dataset, xsd file to "refresh". If I add myself that column in the xsd and run the simple CRUD to see if that works ... no data are saved in the mySQL database.
No refresh button, no manual addition works. This should be simple but I am now desperate to find how to do it.
"don't forget to save and forward engineer the mySQL changes" would not be an answer to my problem ... I double checked that.
-- a newbie

Related

How do you create a local database in visual studio

I am new to visual studio.
I made an app using excel vba that converts words into code 128 and display them.
I tried to recreate it, with visual studio, but I have no idea how to create a file that store data.
For example, the barcode code 128 table should be accessible through code to convert a simple text into a barcode view.
I know so far how to create service based database on sql, add column, and rows, but I need to know how to have (or create) a file with stored data to work with (like in excel, you create a sheet filled with data, and then, you can adress it using vba)
You've a really good tutorial's on the internet who helps you building a local database on visual studio.
I'll give you a initial steps to build one:
1st: After you create your project, Go to Project > Add New Item > And Choose Service-based Database
2nd: Open your database located on Solution Explorer with the name: nameyouchoose.mdf
3rd: It will open a DataSource on the Server Explorer where you can add your tables, records, etc...
Good tutorials:
docs
devu.com

Linq To Sql Not recognizing changes to database

Something happened to some of the files in my visual studio project so I had to transfer the working files to a new project.
Everything is working fine except when I try to add new stuff to my database (like a new column) linq to sql does not recognize the changes.
At one point (I think when I opened up the dbml file) something popped up on visual studio saying something to the effect, that the link to the database (I am not sure if it mentioned web.config) is incorrect so they are just going to use the link in the dbml file (or something like that).
How do I get the correct link? and where do I put it?
So linq to sql will recognize changes?
You can right click on any white space on your ".DBML" file and then go to properties option. You'll be able to find the "Conexión(Connection)" option in where there'll be listed all your SQL connections, just pick one and that's it.
Once you have this done Visual Studio will recognize your future changes.
Note: This will help you to establish or change the connection with your SQL server. If you want to update your DBML scheme you can read this: How do I update a Linq to SQL dbml file?

How to fill table in sql server compact/sqllite?

I'm beginner to visual studio and I want to create local DB for c# project
so i installed sql server compact/sqllite for it
after installing it I created a new connection. Then build table
and then executed the table to see option of table I created under drop down menu "table"
I don't understand how to edit that table
when I select edit top 200 rows I see the screen as in image
just one rows. I can't see 200 rows
and on top of that I can't even write in column
is there any special way to do it
or did I miss something that I should have done
'Edit top 200 rows' means edit the data, not the table design (known as the table schema). If there's no data in the table—which if you just created it sounds like the case—you'll need to enter some before you can edit it.
You enter data in Visual Studio by clicking the cell that you want to edit.
Visual Studio 2015 no longer supports design tools for SQL Server CE, so you probably created a SQL Server LocalDB file instead (note no space in the word). That said, you can install Erik EJ's excellent SQL Server CE/SQLite ToolBox extension (more info here).

How to type some values for database table in Visual Studio IDE

I downloaded source code of an ASP.NET MVC book and it looks this, I can see the table but I need to enter some data in it so it can show them to me
Where should I go to enter data?
While you should actually do this in SQL Server Management Studio, Visual Studio does offer you some support to deal with data. To do so, Open Server Explorer (Ctrl+Alt+S) in VS. Create a data connection, if it doesnt exist already to the DB in question by right clicking on Data Connection and click on Add Connection. Since you downloaded the source code for exercises, there is a good chance that they already created one for you. Once you have a connection to your desired database, you will be able to see database object under that including tables. To add data to a table, right click on that table and click on Show Table Data. You can then go to individual cells and enter data. Hitting enter should submit the data change to SQL Server.
Hope this helps..

Databases in winforms c#

I can't understand how to manage database with Entity Framework.
I'll try to describe my problem step-by-step
create winforms application
add database (.mdf) to solution
when appears window "choosing database model", select dataset
then finish, as database is empty
go to server explorer, choose created database, create some tables
add to solution EDM ADO.NET
The problem is that new data doesn't appear in my database in server explorer. This means that while my Winforms app is working, I can modify my database (change existing values, add new, ..). but if I close my app, there is no update in my database in server explorer. I DON'T forget to use function SaveChanges()
P.S. while my app is working, values are updating. Think, that means that data updates in dataset, but not in database. if i am right, give a clue how to update database from dataset.
pps. visual studio 2010 ultimate. sorry for english
dbentity db=new dbentity();
db.items.addobject(new item() {value=something});
db.savechanges();
Don't add the database to your solution. You can use the Server Explorer to add a connection to your database via your existing SQL Server, or you can select your database in the wizard that appears when adding a new EDMX file to your solution.
Did you try either of these? Where did you get stuck?

Categories

Resources