如何在Azure SQL数据库中插入表值 [英] how can i insert table values in azure SQL database

查看:125
本文介绍了如何在Azure SQL数据库中插入表值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我试图通过Windows Phone7中的wcf服务将表值插入到Azure SQL数据库中.请任何人帮助我如何插入值.

TIA
nareshrajuu

hi all,

i am trying to insert a table values into azure sql database through wcf service in windows phone7. please any body help to me how can i insert values.

TIA
nareshrajuu

推荐答案

下面是一系列四篇文章,将逐步说明如何使用Windows Phone 7应用程序中的WCF services to access SQL Azure Database:
如何使用WCF服务从Windows Phone 7应用访问SQL Azure数据库–第1部分 [如何使用WCF服务从Windows Phone 7应用访问SQL Azure数据库–第2部分 [如何使用WCF服务从Windows Phone 7应用访问SQL Azure数据库–第3部分 [如何使用WCF服务从Windows Phone 7应用访问SQL Azure数据库–第4部分 [
Here is a series of four articles which will step by step explains, how to use WCF services to access SQL Azure Database from Windows Phone 7 app:
How to use WCF services to access SQL Azure Database from Windows Phone 7 app – Part 1[^]
How to use WCF services to access SQL Azure Database from Windows Phone 7 app – Part 2[^]
How to use WCF services to access SQL Azure Database from Windows Phone 7 app – Part 3[^]
How to use WCF services to access SQL Azure Database from Windows Phone 7 app – Part 4[^]


wcf服务操作合同中的


使用下面的连接字符串,用于SQL天蓝色代码
in wcf service operation contract use the follwoing connection string which is for sql azure code
SqlConnection con = new SqlConnection("Server=tcp:your server name;Database=Registration;user id=user id;password=password;Trusted_Connection=False;Encrypt=True;");



现在,使用以下代码编写用于将数据插入数据库的代码



now write the code for inserting the data into the database by using following code

SQlCommand cmd=new SqlCommand();
cmd.Connection = con;
            cmd.CommandText = "insert into DownloadsData values(''" + pc.Username + "'',''" + pc.Title + "'')";
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();


i遵循了以下步骤

我登录Windows Azure Sql数据库
在那-> goto设计
选择可编辑表格的表格
然后----->转到编辑

然后选择数据--->
然后编辑您的心轴
(假设您要添加新行,请在表的底部也单击addnewrow,同时也添加列).
之后,我们应该单击保存",否则将不会更改.

就是这样!!!!!!!!!!!.
i followed these steps

i login into windows Azure Sql database
inthat -->goto Design
select the table which you editable table
then----->goto edit

then select Data --->
and then edit your perticulars
(suppose if u want to add new row click on addnewrow in the bottom of your table aswllas add column also)
after that we should click on the Save otherwise won''t be change.

that''s all!!!!!!!!!!!.


这篇关于如何在Azure SQL数据库中插入表值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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