Click here to Skip to main content
15,893,663 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I have this problem
I have created DataSet called DataReport and placed table from Sql Server on it. then on form I placed reportviewer and designed new report

everything went smoothly

now I am not using connectionstring automatically, but threw Settings, anyway I have this Code

daData1 is tableadapter
DataReport is dataset that I created
DataDetails is the name of the Table on DataReport
rp is reportviewer

daData1.SelectCommand = new SqlCommand("SELECT * from DataDetails", cs);
DataReport.Clear();
daData.Fill(DataReport.DataDetails);

problem is that at one time everything was fine, worked fine, but my cpu crashed, havent saved, and made code again, but now DataReport is not working, it highlights as FORM not as DataSET

I dont know what is going on,

any help thank you
Posted
Comments
ZurdoDev 20-Aug-12 11:06am    
What's the error? It isn't clear what is exactly broken now.

hii,
just change

daData.Fill(DataReport,"DataDetails");
 
Share this answer
 
Comments
shonezi 20-Aug-12 8:31am    
and this also worked, thank you all
If the same code is not working, restart your computer, sounds like something is broken.
 
Share this answer
 
Comments
shonezi 20-Aug-12 7:44am    
I restarted, same thing, I am puzzled, it worked now it doesnt, and I have done everything the same, maybe it is something in properties
shonezi 20-Aug-12 7:46am    
it says I dont have object reference, but it worked before????
Christian Graus 20-Aug-12 7:47am    
What object is null ? What makes you think it shouldn't be null ? I bet it is null and you missed a line from what you typed before.
shonezi 20-Aug-12 7:51am    
it says an object reference is required for non-static field, method or property System.Data.DataSet.Clear();
shonezi 20-Aug-12 7:51am    
I have no idea what is that

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900