my table updates but the view that uses it does not

  • Thread starter Norm via DotNetMonster.com
  • Start date
N

Norm via DotNetMonster.com

How do you get a view to update when a table it uses is updated? I am using
asp.net, C# and MS SQL.

Thanks in advance - Norm
 
N

Norm via DotNetMonster.com

When I run the following code, my table "Forms" updates properly. My
problem is that a View in my database which includes the table Forms, does
not update along with it. My thoughts are that this is a SQL Server issue -
I am presently looking into Triggers to fire off of the updating of the
table. Am I barking up the wrong tree?

Thanks,
Norm

srstr3 = "SELECT * FROM Forms WHERE Formnum = '" + formnum + "'";
sqlConnection1.Open();
sqlDataAdapter4.SelectCommand.CommandText = srstr3;
sqlDataAdapter4.Fill(dataSet71);
sqlConnection1.Close();
DataRow r7 = dataSet71.Tables[0].Rows[0];
r7["GoodQty"] = int.Parse(Label25.Text);
r7["LocationId"] = int.Parse(Label17.Text);
r7["ReworkQty"] = int.Parse(Label26.Text);
r7["RWLocId"] = int.Parse(Label19.Text);
r7["OldNumber"] = Request["oldnum"].ToString();
r7["Notes"] = Request["notes"].ToString();
sqlConnection1.Open();
sqlDataAdapter4.Update(dataSet71);
sqlConnection1.Close();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top