[英]Manipulate DATA FILE (text) stored as varbinary(max) in sql table
在尋求幫助且需要指明正確的方向時,有人可以協助嗎?
有一個包含10000個數字/數據點的數據文件(txt)。 將數據文件作為varbinary(MAX)存儲在SQL表中。
我的目標是根據用戶請求檢索文件,並以折線圖的形式繪制/繪制數字。
讓DataReader將數字直接顯示在屏幕上沒有問題,但是我對如何將數字放入DataSet(或表)以繪制圖表感到困惑。
誰能提供建議或指示?
非常感謝。 溷
我假設從數據庫中檢索數據點時,這些數據點由換行符分隔。
可能有一種更聰明的.Net方法可以幫助您完成此任務,但是一種實用的方法(如果是基本方法)將類似於(在VB .Net-或我的粗略近似中):
'create a new datatable
Dim myDT As New DataTable("DataPoints")
'add a column to the data table (assuming your data is integer)
myDT.Columns.Add("Point", System.Type.GetType("System.Int32"))
'split the string containing the points into an array
dim pointArray as string() = pointString.Split(vbcrlf)
'add the points to the data table
dim s as string
foreach s in pointArray
myDT.Rows.Add(Int32.Parse(s))
next
這是基本的-一些錯誤處理將是一個好主意-但希望它可以幫助您入門。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.