473,385 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

XML doc from TextBox specified SP Parameter

I am trying to create a VB form which will create an xml document based upon
a text input box which relates to the @ItemNumber paramater within the SQL
stored procedure.
I have the create XML doc step which relates to my stored procedure to pull
back a specific ItemNumber/set of ItemNumbers, and then sends it through an
XSL for tranformation .... but I can't figure out how to add this to a
windows form to where a text box can specify the ItemNumber(s) to pull??

Can someone help me out please, I am a newbie here and VERY lost in a swirl
of code!

Thanks in advance!!
----CODE----------------------
'SqlXml_SqlQuery2File
Imports System
Imports System.IO
Imports System.Xml
Imports Microsoft.Data.SqlXml 'The SQLXML managed classes
Module Module1
Sub Main()
'Instantiate the SqlXmlCommand object and the connection
Dim objSqlXmlCmd As New SqlXmlCommand("Provider=SQLOLEDB;" _
& "Server=BEETHOVEN;Database=DSP;" _
& "Integrated Security=SSPI")
'Set type of query
objSqlXmlCmd.CommandType = SqlXmlCommandType.Sql
objSqlXmlCmd.CommandText = "exec StoredProcedure"
objSqlXmlCmd.RootTag = "Catalog"

objSqlXmlCmd.XslPath = "Format.xsl"

'execute into stream readed
Dim objStrmReader As New StreamReader(objSqlXmlCmd.ExecuteStream())
'prepare destiantion file
Dim objResult As New FileStream("Result.xml", FileMode.Create)
Dim objStrmWriter As New StreamWriter(objResult)

'write result into destination file
objStrmWriter.WriteLine(objStrmReader.ReadToEnd())

objStrmWriter.Close()
objResult.Close()
objStrmReader.Close()
End Sub
End Module
Nov 12 '05 #1
0 802

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeff | last post by:
I am using SQL Server 2000. I have a table with, say, 20 columns. I have one procedure which updates all 20 columns at once, accepting a parameter for each column. However, I want to be able to...
7
by: I am Sam | last post by:
I have a DataGrid that is passing information to a stored procedure properly but the parameters aren't being casted properly. I was woundering if anyone can tell me how I should properly cast the...
9
by: D. Shane Fowlkes | last post by:
(ASP.NET 2 / VB) Question - How can I write a If statement to see if a control (textbox) actually exists on a page? Upon page_load, a certain control may or may not be visible on the page so I...
0
by: Ed | last post by:
All of a sudden my previously working code started throwing this error. from the SqlDatasource. I am using C# and Asp.net 2.0. Getting the following error: You have specified that your delete...
0
by: David Lozzi | last post by:
Howdy, ASP.Net 2.0 using VB on SQL 2005 This is a two fold issue. I have a DetailsView control which users can insert or edit items. Editing works great. Insert works great however I need...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
0
by: mutlyp | last post by:
I have a PreRender event to set the width of my textbox when the Edit button is pressed on my grid here is the code: Private Sub grdPBC_PreRender(ByVal sender As Object, ByVal e As...
2
by: mc | last post by:
Can someone suggest how I would add a new trigger such that when the JS event onkeyup in a textbox the updatePanel refreshes? If not could someone sugest how I could onkepup in a Textbox, refresh...
2
by: | last post by:
I have a gridview with a textbox in an ItemTemplate, as below. The OnTextChanged event fires okay but how do I pass a parameter to it, I get an error when I try "OnTextChanged(""SomeData"")". I...
1
by: Kageoni2 | last post by:
I'm trying to add new records to my database using 4 textboxes, one for each field in my databases table. I've got ID, Firstname, Surname and Course. But I can't figure out at all how to link...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.