Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Posted

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();
 
Share this answer
 
Comments
Unareshraju 15-May-12 7:03am    
thank u so-much to reply,
please could you suggest to me through the example url,s.
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!!!!!!!!!!!.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900