如何将数据从窗口mobile6应用程序表单插入SQLCE数据库表 [英] how to insert data from window mobile6 application form to SQLCE database table

查看:48
本文介绍了如何将数据从窗口mobile6应用程序表单插入SQLCE数据库表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从mobile6.0申请表中将以下信息存储在Sqlce3.5数据库中
我有两个问题.

1:显示错误数据库路径不正确",
我的数据库路径是"C:\ Users \ SHAMS \ Documents \ app.sdf"

请进行连接.

2:我要将以下新用户信息存储到
窗口mobile6.o应用程序窗体中sqlce3.5数据库中的USER表.

1个用户名
2个用户地址
3个使用者国家/地区
4个用户NIC


请帮助我

hi i want to store the following information in Sqlce3.5 database from window mobile6.0 Application Form
i have two problem.

1: it show the Error "Database path is nor correct ",
my database path is "C:\Users\SHAMS\Documents\app.sdf "

please make the connection .

2: i want to store the following information of New user in to
USER Table in sqlce3.5 database from window mobile6.o application Form.

1 user name
2 user address
3 user country
4 user NIC


PLEASE HELP ME

推荐答案

1.打开SQL连接.记住,我们使用的是SQLCE,而不是普通的SQL,因此您需要添加SQLCE命名空间,我认为它是using System.Data.Sqlce;

2.创建SQLCe命令对象并编写插入查询"INSERT INTO Users VALUES("用户名,地址,国家/地区,NIC)

3.在SQLCE命令对象上调用ExecuteNonQuery.

戴夫
1. Open SQL connection. Remember, we are using SQLCE not normal SQL so you need to add the SQLCE namespace, I think it is using System.Data.Sqlce;

2. Create SQLCe command object and write the insert query "INSERT INTO Users VALUES (''username, address, country, NIC)

3. call ExecuteNonQuery on the SQLCE command object.

Dave


这篇关于如何将数据从窗口mobile6应用程序表单插入SQLCE数据库表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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