A
aspiring geek
Hi all,
I'm new to asp.net, and using Visual Web Dev express. As such I cannot
see the spreadsheet control and directly access the object properties
from the VB code in the back of my page.
I have declared it as an object as follows:
<object classid="clsid:0002E559-0000-0000-C000-000000000046"
id="Spreadsheet1" name="Spreadsheet1" style="width: 331px; height:
215px" >
note: all users have Office 2003 Web Components
Can only interact with this user entered data client-side, via
"document.all.item("Spreadsheet1").csvdata"
<input type=hidden id="TextBox1" name="TextBox1" />
Can only use this client side, so I can't get the contents of
spreadsheet in here and use it on the server. (If someone knows how it
can be done, please share )
<asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine"
AutoPostBack="True" Height="76px" Width="99px"
Visible="false"></asp:TextBox>
This is an asp box, so users can interact with, but it is not
recognized in client side vbscript. It works if I make it visible and
paste directly.
I was also unsuccessful at getting a javascript function to recognize
this textbox. I kept getting "Object Required" errors.
What I am trying to do is get the csvdata into my temp table. I tried
to do it in the following function (VB on back) and it works if I can
get the data:
Private Sub fnBeforePaste(ByVal txtPassed As String)
Dim i As Int32
Dim Idata() As String = Split(txtPassed, Chr(13) & Chr(10))
'or use Environment.Newline
If InStr(txtPassed, Environment.NewLine) Then
MsgBox("Environment.Newline")
For i = 0 To Idata.GetUpperBound(0) - 1
Dim stCells() As String = Split(Idata(i), Chr(9)) 'or
use ',' for csvdata
stCells(0) = Replace(stCells(0), Chr(10), "")
If Len(stCells(0)) < 2 Then GoTo ExitPasteGrid
AccessDataSource2.InsertCommand = "INSERT INTO Temptbl
(ESN,[MIN]) SELECT '" & stCells(0) & "' AS Expr1, '" & stCells(1) & "'
AS Expr2;"
'"INSERT INTO Temptbl ( ESN, [MIN] ) SELECT " & stCells(0)
& "," & stCells(1)
AccessDataSource2.Insert()
Next
ExitPasteGrid:
'TextBox2.Text = ""
GridEntry.DataBind()
End Sub
This way I can run a query in the database, and return the query
results in a second grid on the page. I have to use something easy for
users to enter two columns of unknown rows of numerical text values in
a temp table in order to join it to the other query table.
Any suggestions on how to approach this problem are much appreciated.
I'm new to asp.net, and using Visual Web Dev express. As such I cannot
see the spreadsheet control and directly access the object properties
from the VB code in the back of my page.
I have declared it as an object as follows:
<object classid="clsid:0002E559-0000-0000-C000-000000000046"
id="Spreadsheet1" name="Spreadsheet1" style="width: 331px; height:
215px" >
note: all users have Office 2003 Web Components
Can only interact with this user entered data client-side, via
"document.all.item("Spreadsheet1").csvdata"
<input type=hidden id="TextBox1" name="TextBox1" />
Can only use this client side, so I can't get the contents of
spreadsheet in here and use it on the server. (If someone knows how it
can be done, please share )
<asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine"
AutoPostBack="True" Height="76px" Width="99px"
Visible="false"></asp:TextBox>
This is an asp box, so users can interact with, but it is not
recognized in client side vbscript. It works if I make it visible and
paste directly.
I was also unsuccessful at getting a javascript function to recognize
this textbox. I kept getting "Object Required" errors.
What I am trying to do is get the csvdata into my temp table. I tried
to do it in the following function (VB on back) and it works if I can
get the data:
Private Sub fnBeforePaste(ByVal txtPassed As String)
Dim i As Int32
Dim Idata() As String = Split(txtPassed, Chr(13) & Chr(10))
'or use Environment.Newline
If InStr(txtPassed, Environment.NewLine) Then
MsgBox("Environment.Newline")
For i = 0 To Idata.GetUpperBound(0) - 1
Dim stCells() As String = Split(Idata(i), Chr(9)) 'or
use ',' for csvdata
stCells(0) = Replace(stCells(0), Chr(10), "")
If Len(stCells(0)) < 2 Then GoTo ExitPasteGrid
AccessDataSource2.InsertCommand = "INSERT INTO Temptbl
(ESN,[MIN]) SELECT '" & stCells(0) & "' AS Expr1, '" & stCells(1) & "'
AS Expr2;"
'"INSERT INTO Temptbl ( ESN, [MIN] ) SELECT " & stCells(0)
& "," & stCells(1)
AccessDataSource2.Insert()
Next
ExitPasteGrid:
'TextBox2.Text = ""
GridEntry.DataBind()
End Sub
This way I can run a query in the database, and return the query
results in a second grid on the page. I have to use something easy for
users to enter two columns of unknown rows of numerical text values in
a temp table in order to join it to the other query table.
Any suggestions on how to approach this problem are much appreciated.