Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
Select () certain Row from Table in Database to XML file
Bondari Developers
Feb 4 2016 3:23 AM
265
Reply
Hello C# Corner ,
I want to select only one row from table and save that data of the only selsected row in xml file,
That row i want its information will be (TextBox.Text). Any information will be in the textbox it will save data to xml file.
this is my Code:
ConnectionString = @"Data Source=LocalDB\SQLEXPRESS;Initial Catalog=TestDB;Integrated Security=True";
connection = new SqlConnection(ConnectionString);
sql = "
Select * from Table_Sub where ActivationCode = "" "; // Please can someone help me here.
try
{
connection.Open();
adapter = new SqlDataAdapter(sql, connection);
adapter.Fill(ds);
connection.Close();
ds.WriteXml("
Subscription.xml
");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
display error message
Login automatically to window application in C#