Webmatrix 3 Sql Server CE 4 失败了? [英] Webmatrix 3 Sql Server CE 4 Busted?

查看:30
本文介绍了Webmatrix 3 Sql Server CE 4 失败了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,当我在新的 Webmatrix 3 中创建一个 sql server CE .sdf 数据库时,我遇到了一个问题.我已经缩小了一个例子.

Ok, when I create a sql server CE .sdf database in the new Webmatrix 3 I run into a problem. I've narrowed an example down to this.

1) 我创建了一个名为 test 的表.一列test_ID"是一个 bigint、主键和一个身份.2) 我创建了另一个名为test_desc"的列,它是一个带有所有默认值的 nvarchar(50).

1) I create a table called test. One column "test_ID" is a bigint, primarykey, and an identity. 2) I create another column called "test_desc" which is a nvarchar(50) with all the defaults.

问题.

我无法使用 GUI 插入数据.无法修改有关列名称的某些内容.对于一个新版本刚开始就有如此巨大的错误,这非常烦人,也有点令人失望.其他人遇到过这个问题或有解决方法吗?我可以为插入编写一个 SQL 语句,这可能会奏效.但是为什么要有 GUI 呢?

I cannot insert data using the GUI. Something about the column name cannot be modified. This is very annoying and somewhat disappointing for a new release to have such a huge bug just off the get go. Anyone else run into this or have a work around? I could write a SQL statement for the inserts, that might work. But then why have a GUI?

此外,我使用 webmatrix 3 创建了一个新数据库,但问题仍然存在(原始站点是使用 Webmatrix 2 创建的,数据输入 GUI 与 Webmatrix 2 在现在不接受 Webmatrix 3 插入的表上运行良好).

Also, I created a new database with webmatrix 3 and the problem still existed (original site was created with Webmatrix 2 and the data entry GUI worked fine with Webmatrix 2 on tables that do now not accept inserts with Webmatrix 3).

我也卸载并重新安装只是为了笑,没有爱.

Also I did an uninstall and reinstall just for laughs, no love.

推荐答案

我今天遇到了同样的问题.在升级到 WebMatrix 3 之前已经有一个 CE 数据库,即使在现有表上我也无法插入新数据,因为它们有一列带有主键和标识.在微软发布补丁来克服这种情况之前,我已经提出了一个解决方案.如果您需要插入包含数据的新行,请尝试以下操作.

I was faced today with the same problem. Already had a CE database prior to upgrading to WebMatrix 3, and I was no more able to insert new data even on existing tables as they have a column with a primary key and identity. I've come out with a solution until Microsoft releases a patch to overcome the situation. Try the following if you need to insert new rows with data.

  1. 在主页中打开一个新的查询文档.
  2. 插入包含一些数据的虚拟行,其中一行类似于以下内容:INSERT INTO tablename (columnname) VALUE ('dummydata')
  3. 执行查询

使用虚拟数据(如果您愿意,也可以使用有效数据)创建一个新行,并为主键自动生成一个值.现在,如果需要,您可以编辑该行并用您想要的值填充它.如果需要更多行,请重复执行查询.

A new row is created with dummy data (or with valid data if you are willing to) and a value is automatically generated for the primary key. Now, if you need, you can go and edit the row and fill it with the values you want. Repeat query execution if you need more rows.

希望这会有所帮助.

问候

这篇关于Webmatrix 3 Sql Server CE 4 失败了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆