.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Dataset populating with junk values

Posted By: Siddharth     Posted Date: September 13, 2012    Points:5   Category :C#
hi,
I am filling the dataset from the records from the database.
but when i look into the dataset after some rows(118th row) the values of the column are turning to junk values.
These values are turning to junk values in all the fetched column.

Please help its urgernt.
regards,
sid

Responses
Author: Creative13             
Posted Date: September 18, 2012     Points: 20   

hey siddharth....

you can do this.....by just improving your code for it..

just make sure that...you are Clearing the contents of dataset every time before a new data is added to it.

mean...e.g.

Dataset dset=new Dataset();

dset.clear(); //clears the content of dataset (if any)

//After this CODE LINE
// fill the Dataset with required table...



i'm sure this will work.....

Author: Siddharth             
Posted Date: September 18, 2012     Points: 20   

hi,
I have tried this but this did not worked.
I was able to figure out the problem which was very starnge.
Since i have to deliver it urgently i did the workaround.

When i was using the order by clause in the query then only this problem was coming.
Then i tried using order by ASC,which also did not work.
Then i tried order by DESC and to my suprise it worked.I still do not why it is behaving like that.
What i did is remove the order by clause and added the datatable to dataview and then sort the dataview :-)
This is just the work around but still i am wondering of the exact issue :-(

regards,
sid



Author: Creative13             
Posted Date: September 18, 2012     Points: 20   

hey siddharth....

got it....


the same problem i have faced during my academic project....

the senior to me ...told me that i should concentrate on the Exact Column name while calling through query if it has several things to do for intended result..

so...same thing i suggest you that...you should again check the QUERY u are passing...with their appropriate way of use...(means Syntactical use)

Author: Siddharth             
Posted Date: September 18, 2012     Points: 20   

hi,
i am not getting what you are trying to say.
I used the straight forward query like SELECT COL1,COL2,COL3 FROM TAB1 ORDER BY COL1.
I have not used aliases for the column also




Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend