TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
spots Knight
NA
35
2.8k
Second DataSet not recognized
Sep 16 2014 12:57 PM
I am attempting to add a separate distinct dataset to my application. I've created the .xsd file and the class I am working in has the Using Sytem.Data. Everything LOOKS like it should be fine and looks exactly like another class that is the first dataset. However when I declare the dataset to create an instance of it, the code does not recognize it. They are both in the same namespace.
I'm fairly sure it is something simple I'm missing but I just can't see what.
This works
class ExportYTDs
{
OleDbDataAdapter dadapt = new OleDbDataAdapter();
public void ExportFile(string ExportfilePath, string coNumber, OleDbConnection dbConn)
{
try
{
String lSQL = "my sql Statement Here";
dadapt = new OleDbDataAdapter(lSQL, dbConn);
ds DSCo = new ds()
; // <------- This is my dataset declaration that works
DSCo.ExportYTD.Clear(); //Clear Table
dadapt.Fill(DSCo.ExportYTD); //Fill table based on above SQL
//Export the data
if (ExportYTD.Rows.Count > 0)
{ //Code to export to Excel Here }
}
catch (Exception ex)
{//Handle Errors }
}
This DOESN'T :(
class ExportCoProfile
{
OleDbDataAdapter dadapt = new OleDbDataAdapter();
public void ExportFile(string ExportfilePath, string coNumber, OleDbConnection dbConn)
{
try
{
String lSQL = "my sql Statement Here";
dadapt = new OleDbDataAdapter(lSQL, dbConn);
cp Profile= new cp();
// <------- This is my dataset declaration that fails
Profile.coProfile.Clear(); //Clear Table
dadapt.Fill(Profile.coProfile); //Fill table based on above SQL
//Export the data
if (CoProfile.Rows.Count > 0)
{ //Code to export to Excel Here }
}
catch (Exception ex)
{//Handle Errors }
}
Reply
Answers (
1
)
i tried but in my stored procedure output is getting correct
Multiple Inheritance is not allowed in C#?