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.
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());
}