Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,455 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,945 people online right now. Registration is fast and FREE... Join Now!




Table Adapter Update method missing?

 
Reply to this topicStart new topic

Table Adapter Update method missing?

thor78
11 Aug, 2008 - 05:12 PM
Post #1

D.I.C Head
Group Icon

Joined: 6 May, 2008
Posts: 106


Dream Kudos: 50
My Contributions
I'm having this frustrating problem where my Intellisense does not show my table adapter's Update method.
Here is the snippet with the update:

csharp

[System.ComponentModel.DataObjectMethodAttribute
(System.ComponentModel.DataObjectMethodType.Insert, true)]
public bool AddSurvey(string title, string description,
DateTime startDate, DateTime endDate, int batchNumber, TimeSpan timeCreated)
{
// Create a new SurveyRow instance
OnlineSurvey.SurveysDataTable surveys = new OnlineSurvey.SurveysDataTable();
OnlineSurvey.SurveysRow survey = surveys.NewSurveysRow();

survey.Title = title;
survey.Description = description;
survey.StartDate = startDate;
survey.EndDate = endDate;
survey.BatchNumber = batchNumber;
survey.TimeCreated = timeCreated;

// Add the new product
surveys.AddSurveysRow(survey);
int rowsAffected = Adapter.Update; //<-- Does not show in intellisense

// Return true if precisely one row was inserted,
// otherwise false
return rowsAffected == 1;
}


And here is the code for the table adapter:
csharp

private SurveysTableAdapter _surveysAdapter = null;
protected SurveysTableAdapter Adapter
{
get
{
if (_surveysAdapter == null)
{
_surveysAdapter = new SurveysTableAdapter();Adapter.
}
return _surveysAdapter;
}
}


My datasets are OK and the table adapters are fine, but I can't seem to get Update to show up.

This post has been edited by thor78: 11 Aug, 2008 - 05:15 PM
User is offlineProfile CardPM
+Quote Post

Footsie
RE: Table Adapter Update Method Missing?
12 Aug, 2008 - 01:01 AM
Post #2

D.I.C Regular
Group Icon

Joined: 20 Sep, 2007
Posts: 305



Thanked: 4 times
Dream Kudos: 50
My Contributions
I've had a similar problem before. It was because I edited the Adapter/query outside of the designer wizard (changed its name or something). Go to your dataset designer and right click the adapter query and select configure. Rename it through the wizard and set the query, all through the wizard (even if it all looks correct - just redo it). Then save and test it.

Hope it helps.

This post has been edited by Footsie: 12 Aug, 2008 - 01:07 AM
User is offlineProfile CardPM
+Quote Post

thor78
RE: Table Adapter Update Method Missing?
12 Aug, 2008 - 04:35 PM
Post #3

D.I.C Head
Group Icon

Joined: 6 May, 2008
Posts: 106


Dream Kudos: 50
My Contributions
I was able to fix it yesterday - after a lot of head scratching. When I added a new column to my table, visual studio's dumb dataset designer deletes the previous insert, delete and update commands from the table adapter, resulting to a missing or non-existent Update method.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 03:24PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month