compact-database

How to change column width in DataGridView?

戏子无情 提交于 2020-05-11 04:04:44
问题 I have created a database and table using Visual Studio's SQL Server Compact 3.5 with a dataset as my datasource. On my WinForm I have a DataGridView with 3 columns. However, I have been unable to figure out how to get the columns to take up the full width of the DataGridView which is shown in the image below. I want to make the abbreviates column wider and then have the description column extend all the way over to the edge of the form. Any suggestions? Update: using System; using System

How to rename a table in the sql server compact edition

二次信任 提交于 2019-12-22 04:57:11
问题 I'm new to SQL Server Compact edition. I'm using Compact edition 3.5. I tried renaming the table. But, I couldn't do that through the following query. alter table tablename to newname Plz, someone help me......... 回答1: Try this sp_rename '[OldTableName]' , '[NewTableName]' Check links below for more information http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/ http://erikej.blogspot.com/2007/08/hidden-gem-rename-table.html Good Luck! UPDATE Here you

Compact or renumber IDs for all tables, and reset sequences to max(id)?

走远了吗. 提交于 2019-12-20 10:54:48
问题 After running for a long time, I get more and more holes in the id field. Some tables' id are int32, and the id sequence is reaching its maximum value. Some of the Java sources are read-only, so I cannot simply change the id column type from int32 to long , which would break the API. I'd like to renumber them all. This may be not good practice, but good or bad is not concerned in this question. I want to renumber, especially, those very long IDs like "61789238", "548273826529524324". I don't

How to enable auto-increment with Sql compact & C#

情到浓时终转凉″ 提交于 2019-12-06 15:06:04
问题 I'm using C# 2010 Express. I have created a SQL Server CE database file ( .sdf ) then created Information table and ID, Name, City columns with Database Explorer. I want to save names and city user will write to the form. The auto-increment option is disabled in Database explorer and Properties windows. When I'm saving something to that database i must change the ID manually, how can I make ID column auto-increment enabled? 回答1: There is a simple way for SQL CE: ALTER TABLE TableName ALTER

How to rename a table in the sql server compact edition

天涯浪子 提交于 2019-12-05 05:48:11
I'm new to SQL Server Compact edition. I'm using Compact edition 3.5. I tried renaming the table. But, I couldn't do that through the following query. alter table tablename to newname Plz, someone help me......... hgulyan Try this sp_rename '[OldTableName]' , '[NewTableName]' Check links below for more information http://blog.sqlauthority.com/2008/08/26/sql-server-how-to-rename-a-column-name-or-table-name/ http://erikej.blogspot.com/2007/08/hidden-gem-rename-table.html Good Luck! UPDATE Here you can find a similar question How do I rename a table in SQL Server Compact Edition? You can try this

How to enable auto-increment with Sql compact & C#

若如初见. 提交于 2019-12-04 21:08:46
I'm using C# 2010 Express. I have created a SQL Server CE database file ( .sdf ) then created Information table and ID, Name, City columns with Database Explorer. I want to save names and city user will write to the form. The auto-increment option is disabled in Database explorer and Properties windows. When I'm saving something to that database i must change the ID manually, how can I make ID column auto-increment enabled? There is a simple way for SQL CE: ALTER TABLE TableName ALTER COLUMN ColumnName IDENTITY (/*seed*/1, /*increment*/1) 来源: https://stackoverflow.com/questions/5052922/how-to

Compact or renumber IDs for all tables, and reset sequences to max(id)?

牧云@^-^@ 提交于 2019-12-03 01:18:08
After running for a long time, I get more and more holes in the id field. Some tables' id are int32, and the id sequence is reaching its maximum value. Some of the Java sources are read-only, so I cannot simply change the id column type from int32 to long , which would break the API. I'd like to renumber them all. This may be not good practice, but good or bad is not concerned in this question. I want to renumber, especially, those very long IDs like "61789238", "548273826529524324". I don't know why they are so long, but shorter IDs are also easier to handle manually. But it's not easy to