11 Replies - 884 Views - Last Post: 17 May 2009 - 08:00 AM Rate Topic: -----

#1 jeff87  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 85
  • Joined: 17-March 09

After publish!

Posted 14 May 2009 - 01:21 AM

my program runs perfectly when its in VS2008(solution explorer),but thenn after i publish it...it still can run, when i key in new data which will save to access,it did save.....i'd did validation on it,like account created succesfully...it does giv me this sentence...i check the record and it does save ....but my datagridview wont show the new record!wat happen?

This post has been edited by jeff87: 14 May 2009 - 08:11 AM

Is This A Good Question/Topic? 0
  • +

Replies To: After publish!

#2 Bort  Icon User is offline

  • Ill-informed Mongoloid
  • member icon

Reputation: 406
  • View blog
  • Posts: 2,995
  • Joined: 18-September 06

Re: After publish!

Posted 14 May 2009 - 08:06 AM

What??? Try again. This time use english, and full words.
Was This Post Helpful? 0
  • +
  • -

#3 jeff87  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 85
  • Joined: 17-March 09

Re: After publish!

Posted 14 May 2009 - 10:09 PM

anyone?my dataset wont be updated,only microsoft access get updated...
Was This Post Helpful? 0
  • +
  • -

#4 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: After publish!

Posted 14 May 2009 - 10:43 PM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks.
Was This Post Helpful? 0
  • +
  • -

#5 jeff87  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 85
  • Joined: 17-March 09

Re: After publish!

Posted 14 May 2009 - 11:19 PM

are you ok?i am not asking for free lunch,i just ask for comments,do i need to post my full code here and you check for me?

cheers
Was This Post Helpful? 0
  • +
  • -

#6 Ändrew  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 25
  • View blog
  • Posts: 312
  • Joined: 21-April 08

Re: After publish!

Posted 14 May 2009 - 11:42 PM

Post the code you are having troubles with...
Was This Post Helpful? 0
  • +
  • -

#7 jeff87  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 85
  • Joined: 17-March 09

Re: After publish!

Posted 15 May 2009 - 12:42 AM

all of my code works fine in the solution explorer,now the problem is after i publish it,its not running like in the solution explorer.please see my question carefully!
thx!
Was This Post Helpful? 0
  • +
  • -

#8 Bort  Icon User is offline

  • Ill-informed Mongoloid
  • member icon

Reputation: 406
  • View blog
  • Posts: 2,995
  • Joined: 18-September 06

Re: After publish!

Posted 15 May 2009 - 01:13 AM

It might help if your OP made sense.

In Solution Explorer, highlight the database file. then in Properties window, check 'Copy to Output Directory' and make sure 'Copy if Newer' is selected.

When you try to update a database, you are actually updating your dataset, not the database. Can you please show us your code for saving stuff to the database so we can see if anything is missing?
Was This Post Helpful? 0
  • +
  • -

#9 jeff87  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 85
  • Joined: 17-March 09

Re: After publish!

Posted 15 May 2009 - 01:44 AM

yea sure!so here is my code!
   Dim testdt As New KindergartenDataSet2.KindergartenDataTable
		Dim testda As New KindergartenDataSet2TableAdapters.KindergartenTableAdapter

		Dim c1 As Integer					  'counter for loop
		Dim Cust As String
		Dim CustomerFound As Boolean = False


   
		Cust = Agent_Details.TextBox14.Text


		testdt = testda.GetData
		Agent_Details.DataGridView1.DataSource = testdt
		testdt.DefaultView.RowFilter = "Agent= '" & Agent_Details.TextBox1.Text & "'"


			End If
		Next


these code are meant for import data into datagridview.
and i din use any bindingsource,is it ok?
and the data can be save into access only datagridview wont show updated data....but everythings works fine in the solution explorer.


		Dim newcon As New OleDb.OleDbConnection(constr)
		Dim addstr As String = "INSERT INTO `Subjects`(`Kindergarten_ID`, `BM1`, `BM2`, `BM3`, `BM4`, `BM5`, `BM6`, `Total`, `BI1`, `BI2`, `BI3`, `BI4`, `BI5`, `BI6`, `Total1`, `BC1`, `BC2`, `BC3`, `BC4`, `BC5`, `BC6`, `Total2`, `MA1`, `MA2`, `MA3`, `MA4`, `MA5`, `MA6`, `Total3`, `SC1`, `SC2`, `SC3`, `SC4`, `SC5`, `SC6`, `Total4`, `MO1`, `MO2`, `MO3`, `MO4`, `MO5`, `MO6`, `Total5`, `Agent_ID`) VALUES (add1, add2, add3 ,add4 ,add5, add6, add7, add8, add9, add10 ,add11 ,add12, add13, add14, add15, add16, add17 ,add18 ,add19, add20, add21, add22, add23, add24 ,add25 ,add26, add27, add28, add29, add30, add31 ,add32, add33, add34, add35, add36, add37 ,add38 ,add39, add40, add41, add42, add43, add44)"
		Dim addcomm As New OleDb.OleDbCommand

		Dim newcon1 As New OleDb.OleDbConnection(constr)
		Dim addstr1 As String = "INSERT INTO `Kindergarten`(`Kindergarten_ID`, `Agent`, `Kindergarten_Name`, `Contacts`, `Address`, `Remarks`, `Subjects-Taken`) VALUES (add1, add2, add3 ,add4 ,add5, add6, add7)"
		Dim addcomm1 As New OleDb.OleDbCommand



		addcomm.Connection = newcon
		addcomm.CommandText = addstr

		addcomm1.Connection = newcon1
		addcomm1.CommandText = addstr1

		addcomm.Parameters.AddWithValue("add1", TextBox1.Text)
		addcomm.Parameters.AddWithValue("add2", TextBox5.Text)
		addcomm.Parameters.AddWithValue("add3", TextBox6.Text)
		addcomm.Parameters.AddWithValue("add4", TextBox7.Text)
		addcomm.Parameters.AddWithValue("add5", TextBox8.Text)
		addcomm.Parameters.AddWithValue("add6", TextBox9.Text)
		addcomm.Parameters.AddWithValue("add7", TextBox10.Text)
		addcomm.Parameters.AddWithValue("add8", Label48.Text)
		addcomm.Parameters.AddWithValue("add9", TextBox16.Text)
		addcomm.Parameters.AddWithValue("add10", TextBox15.Text)
		addcomm.Parameters.AddWithValue("add11", TextBox14.Text)
		addcomm.Parameters.AddWithValue("add12", TextBox13.Text)
		addcomm.Parameters.AddWithValue("add13", TextBox12.Text)
		addcomm.Parameters.AddWithValue("add14", TextBox11.Text)
		addcomm.Parameters.AddWithValue("add15", Label49.Text)
		addcomm.Parameters.AddWithValue("add16", TextBox22.Text)
		addcomm.Parameters.AddWithValue("add17", TextBox21.Text)
		addcomm.Parameters.AddWithValue("add18", TextBox20.Text)
		addcomm.Parameters.AddWithValue("add19", TextBox19.Text)
		addcomm.Parameters.AddWithValue("add20", TextBox18.Text)
		addcomm.Parameters.AddWithValue("add21", TextBox17.Text)
		addcomm.Parameters.AddWithValue("add22", Label50.Text)
		addcomm.Parameters.AddWithValue("add23", TextBox28.Text)
		addcomm.Parameters.AddWithValue("add24", TextBox27.Text)
		addcomm.Parameters.AddWithValue("add25", TextBox26.Text)
		addcomm.Parameters.AddWithValue("add26", TextBox25.Text)
		addcomm.Parameters.AddWithValue("add27", TextBox24.Text)
		addcomm.Parameters.AddWithValue("add28", TextBox23.Text)
		addcomm.Parameters.AddWithValue("add29", Label51.Text)
		addcomm.Parameters.AddWithValue("add30", TextBox34.Text)
		addcomm.Parameters.AddWithValue("add31", TextBox33.Text)
		addcomm.Parameters.AddWithValue("add32", TextBox32.Text)
		addcomm.Parameters.AddWithValue("add33", TextBox31.Text)
		addcomm.Parameters.AddWithValue("add34", TextBox30.Text)
		addcomm.Parameters.AddWithValue("add35", TextBox29.Text)
		addcomm.Parameters.AddWithValue("add36", Label52.Text)
		addcomm.Parameters.AddWithValue("add37", TextBox40.Text)
		addcomm.Parameters.AddWithValue("add38", TextBox39.Text)
		addcomm.Parameters.AddWithValue("add39", TextBox38.Text)
		addcomm.Parameters.AddWithValue("add40", TextBox37.Text)
		addcomm.Parameters.AddWithValue("add41", TextBox36.Text)
		addcomm.Parameters.AddWithValue("add42", TextBox35.Text)
		addcomm.Parameters.AddWithValue("add43", Label53.Text)
		addcomm.Parameters.AddWithValue("add44", TextBox2.Text)

		addcomm1.Parameters.AddWithValue("add1", Add_Record.TextBox43.Text)
		addcomm1.Parameters.AddWithValue("add2", Add_Record.ComboBox1.Text)
		addcomm1.Parameters.AddWithValue("add3", Add_Record.TextBox2.Text)
		addcomm1.Parameters.AddWithValue("add4", Add_Record.TextBox42.Text)
		addcomm1.Parameters.AddWithValue("add5", Add_Record.TextBox3.Text)
		addcomm1.Parameters.AddWithValue("add6", Add_Record.TextBox4.Text)
		addcomm1.Parameters.AddWithValue("add7", Add_Record.TextBox41.Text)

		newcon.Open()
		addcomm.ExecuteNonQuery()
		newcon.Close()

		newcon1.Open()
		addcomm1.ExecuteNonQuery()
		newcon1.Close()
	   




		MsgBox("Account Created Successful")
		Main.Show()
		Me.Close()
		Add_Record.Close()


these are for saving new data.
after it was publish....only datagridview wont show updated data...but data does saved into database.

This post has been edited by jeff87: 15 May 2009 - 01:48 AM

Was This Post Helpful? 0
  • +
  • -

#10 Bort  Icon User is offline

  • Ill-informed Mongoloid
  • member icon

Reputation: 406
  • View blog
  • Posts: 2,995
  • Joined: 18-September 06

Re: After publish!

Posted 15 May 2009 - 02:30 AM

So it does save to the database, and you can view the new data in Access. Is that right?

And it does not update the DataGridView on your form, yes?

After updating the database, why not try reloading the DGV? It should be pretty easy, although I can't think how off the top of my head...doh!
Was This Post Helpful? 0
  • +
  • -

#11 jeff87  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 85
  • Joined: 17-March 09

Re: After publish!

Posted 15 May 2009 - 08:35 AM

hmmm reloading...good idea...but i wonder how to do that....
Was This Post Helpful? 0
  • +
  • -

#12 jeff87  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 85
  • Joined: 17-March 09

Re: After publish!

Posted 17 May 2009 - 08:00 AM

anymore idea?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1