Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation
Go Back  Xtreme Visual Basic Talk > > > Loading an immense string taken from an aspx file to a datagridview for manipulation


Reply
 
Thread Tools Display Modes
  #21  
Old 07-24-2008, 02:03 PM
7h0m's Avatar
7h0m 7h0m is offline
Regular
 
Join Date: Feb 2008
Posts: 64
Default


Ok I tried using a different technique... I added the famous <![CDATA[...]]> tag to encapsulate the records. ex:

<Coop><![CDATA[" & RChars(rs.Fields("Coop").Value) & "]]></Coop>

HOWEVER my vb app is STILL telling me about an illegal character... Is it perhaps that the datagridview object does not get the CDATA tag?

edit: for the info CDATA is suppose to tell XML to ignore any special chars between the tags.
__________________
Nasa predicts Pole Shift in 2012. Google it.
Reply With Quote
  #22  
Old 07-24-2008, 03:15 PM
darkforcesjedi's Avatar
darkforcesjediLoading an immense string taken from an aspx file to a datagridview for manipulation darkforcesjedi is offline
Trust me, I'm an

* Expert *
 
Join Date: Apr 2001
Location: In ur base, pwnin d00dz
Posts: 1,964
Default

Why are you using a recordset? The recordset is a member of classic ADO or DAO (I hope you're not using DAO). ADO.NET uses DataSets.

Your code shouldn't have any recordsets. Do some Googling on ADO.NET to familiarize yourself with it.
__________________
To err is human; to debug, divine.
Reply With Quote
  #23  
Old 07-24-2008, 03:33 PM
Optikal's Avatar
OptikalLoading an immense string taken from an aspx file to a datagridview for manipulation Optikal is offline
Codeaholic

Retired Leader
* Guru *
 
Join Date: Oct 2002
Location: Winnipeg, MB, Canada
Posts: 4,543
Default

You're trying to manually serialize/deserialize your data. That's going to give you nothing but headaches. If you use a DataSet it already knows how to serialize and deserialize itself. You should be using that.
__________________
There are 10 types of people in this world, those that understand binary, and those that don't.
Reply With Quote
  #24  
Old 07-25-2008, 09:02 AM
7h0m's Avatar
7h0m 7h0m is offline
Regular
 
Join Date: Feb 2008
Posts: 64
Default

well guys i converted my code to Dataset

Dim ds As New DataSet
Dim conn As New System.Data.SqlClient.SqlConnection("Password=lol;Persist Security Info=True;User ID=lol;Initial Catalog=Phyto_TBL;Data Source=SAGA")

Using conn
Dim cmd As New System.Data.SqlClient.SqlCommand("EXEC USP_LIST_PRODUIT", conn)
conn.Open()
ds.DataSetName = "Produits"
ds.Load(cmd.ExecuteReader(), LoadOption.OverwriteChanges, "Produits")
Response.ContentType = "text/xml"
ds.WriteXml(Response.OutputStream)
End Using

It works... but in my vb app, after converting the string to XML with this:

XmlDataDocument.LoadXml(StringHTML)

And trying to bind a datasource to the grid:

DataGridView.DataSource = XmlDataDocument

it does nothing. And the string does contain the data. So it seems it's the datagridview that is indiferent to the datasource. Am I missing something obvious as to how datagridviews work? any code missing here?
__________________
Nasa predicts Pole Shift in 2012. Google it.
Reply With Quote
  #25  
Old 07-25-2008, 09:18 AM
darkforcesjedi's Avatar
darkforcesjediLoading an immense string taken from an aspx file to a datagridview for manipulation darkforcesjedi is offline
Trust me, I'm an

* Expert *
 
Join Date: Apr 2001
Location: In ur base, pwnin d00dz
Posts: 1,964
Default

Try this instead:

Code:
' read XML string into a DataSet
Dim DS As New DataSet
DS.ReadXML(New StringReader(StringHTML))

' bind DataGrid to DataSet
DataGridView.DataSource = DS.Tables(0)
__________________
To err is human; to debug, divine.
Reply With Quote
  #26  
Old 07-25-2008, 09:29 AM
7h0m's Avatar
7h0m 7h0m is offline
Regular
 
Join Date: Feb 2008
Posts: 64
Default

it compiles and runs, but the datagrid is still empty. I can now see an empty line that wasn't there before.
__________________
Nasa predicts Pole Shift in 2012. Google it.
Reply With Quote
  #27  
Old 07-25-2008, 09:43 AM
Optikal's Avatar
OptikalLoading an immense string taken from an aspx file to a datagridview for manipulation Optikal is offline
Codeaholic

Retired Leader
* Guru *
 
Join Date: Oct 2002
Location: Winnipeg, MB, Canada
Posts: 4,543
Default

try calling DataGridView.DataBind() after setting the datasource
__________________
There are 10 types of people in this world, those that understand binary, and those that don't.
Reply With Quote
  #28  
Old 07-25-2008, 09:48 AM
darkforcesjedi's Avatar
darkforcesjediLoading an immense string taken from an aspx file to a datagridview for manipulation darkforcesjedi is offline
Trust me, I'm an

* Expert *
 
Join Date: Apr 2001
Location: In ur base, pwnin d00dz
Posts: 1,964
Default

I don't have VS here so I can't actually test code. Put a break after DS.ReadXML and make sure it actually contains the table.

I think I messed up:
Code:
DataGridView.DataSource = DS
DataGridView.DataMember = DS.Tables(0)
Try that.
__________________
To err is human; to debug, divine.
Reply With Quote
  #29  
Old 07-25-2008, 09:50 AM
7h0m's Avatar
7h0m 7h0m is offline
Regular
 
Join Date: Feb 2008
Posts: 64
Default

DataBind is not part of the DataGridView object. But thanks for checking in Optikal!
__________________
Nasa predicts Pole Shift in 2012. Google it.
Reply With Quote
  #30  
Old 07-25-2008, 09:55 AM
7h0m's Avatar
7h0m 7h0m is offline
Regular
 
Join Date: Feb 2008
Posts: 64
Default

yippee im getting somewhere with...

DataGridView.DataMember = DS.Tables(0)

...added, it actually fills the datagridview but with all the store proc columns, some of wich i don't want. I can't believe how much pain it will be to scroll inside that thing, well, I'm doing what is expected of me.

I heard of a special property that boosted performance of a datagridview, something about only buffering/displaying the current records being showed. Any ideas what it is?
__________________
Nasa predicts Pole Shift in 2012. Google it.
Reply With Quote
  #31  
Old 07-25-2008, 10:07 AM
darkforcesjedi's Avatar
darkforcesjediLoading an immense string taken from an aspx file to a datagridview for manipulation darkforcesjedi is offline
Trust me, I'm an

* Expert *
 
Join Date: Apr 2001
Location: In ur base, pwnin d00dz
Posts: 1,964
Default

If you want to get rid of some of the columns, you need to disable AutoGenerateColumns and explicitly set the columns to be displayed.

The other thing your referring to is Virtual Mode. This is going to add a bit of work for you to implement and it probably won't make it any faster.
http://msdn.microsoft.com/en-us/library/ms171621.aspx



Alternatively, why send more info from the webserver than you need? Create a stored proc that only returns the columns you want, that way you can save some bandwidth.
__________________
To err is human; to debug, divine.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation
 
Loading an immense string taken from an aspx file to a datagridview for manipulation
Loading an immense string taken from an aspx file to a datagridview for manipulation
 
-->