English 中文(简体)
为窗口电话将数据插入 SQL 服务器 CE
原标题:Insert data into SQL Server CE for windows phone

我想在空数据库中添加一些数据, 这是我的代码之一

private void readSQLCE()
{
    db = new MyDataContext("isostore:/qq.sdf");

    cust newcust = new cust
    {
        C_Id = 1,
        C_Name = "Amop",
        C_Place = "Poik"
    };

    db.CS.InsertOnSubmit(newcust);
}

要将我的数据插入 SQL 服务器 CE 数据库,还需要增加什么?

最佳回答

你需要一个

db.SubmitChanges();
问题回答

暂无回答




相关问题
SQL Copy Row for a list, change one column value

I need to duplicate a row a couple thousand times. I need to change one column from the copied row based on a list of ids. Psuedo-code: INSERT INTO MyTable (TabID, Other Columns) VALUES (TabID = (...

Copy mdf file and use it in run time

After I copy mdf file (and his log file) I tries to Insert data. I receive the following message: "An attempt to attach an auto-named database for file [fileName].mdf failed. A database with the same ...

Inserting trigger (SQL 2005)

I have a temp table (question_desc, ans1, ans2, ans3, ans4, correct_ans, marks) with say 10 entries. From this table I have to insert values in two other tables: questions (q_id(auto-generated), ...

mySQL - Prevent double booking

I am trying to work out the best way to stop double booking in my application. I have a table of unique id s each can be sold only once. My current idea is to use a transaction to check if the ...

热门标签