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