Update Data Problem with Sqlite!
Posted: Thu 25 Jul 2013 13:51
Hi there and Salam!
I am using Visual Studio 2012 with devart dotconnect support as instructed in http://www.devart.com/dotconnect/sqlite ... _linq.html. The problem is i am not able to update the data!
Here is the module!
The problem i am facing is that, i am unable to update (edited) data. Followed this example on the Tutorial Page.
Telling you before hand that it is not the matter of Picture as far as i know because i am not saving any picture, it is null all the time.
This code Gives me no error of any sort, displays the MessageBox that i created, but no data is updated.
I have no clue how to make it working!
Please Help me out!
Regards,
Mirza Muneeb
I am using Visual Studio 2012 with devart dotconnect support as instructed in http://www.devart.com/dotconnect/sqlite ... _linq.html. The problem is i am not able to update the data!
Here is the module!
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
if (textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "" || textBox6.Text == "")
{
MessageBox.Show("Please Fill All The Fields!", "Typing Mistake", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else if (textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && textBox5.Text != "" && textBox6.Text != "")
{
if (pictureBox1.Image != null)
{
string s = Directory.GetCurrentDirectory();
if (!Directory.Exists("Photos"))
{
Directory.CreateDirectory("Photos");
}
pictureBox1.Image.Save(s + "\\Photos\\" + textBox2.Text + ".jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
}
MainDataContext context = new MainDataContext();
Patient newPatient = new Patient();
newPatient.Name = textBox2.Text;
newPatient.Father = textBox3.Text;
newPatient.Dasd = textBox4.Text;
newPatient.Sex = textBox5.Text;
newPatient.Mob = textBox6.Text;
context.SubmitChanges();
MessageBox.Show("Saved!");
this.Dispose();
}
}
Code: Select all
product.ProductName = "Edited product";
product.Price = 15;
context.SubmitChanges();
This code Gives me no error of any sort, displays the MessageBox that i created, but no data is updated.
I have no clue how to make it working!
Please Help me out!
Regards,
Mirza Muneeb