473,406 Members | 2,710 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,406 software developers and data experts.

How import xml to sql 2000 using vb.net

Hello Guys,

How i can do import this stored procedure to sql 2000 ?

After readxml i dont know what i need do.

thanks


<?xml version="1.0" standalone="yes" ?>
- <NewDataSet>
- <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:Locale="es-ES">
- <xs:complexType>
- <xs:choice maxOccurs="unbounded">
- <xs:element name="Table1">
- <xs:complexType>
- <xs:sequence>
<xs:element name="USUARIO" type="xs:string" minOccurs="0" />
<xs:element name="NOMBRE" type="xs:string" minOccurs="0" />
<xs:element name="ROUTINE_DEFINITION" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
- <Table1>
<USUARIO>[dbo]</USUARIO>
<NOMBRE>[DeleteAplicacion]</NOMBRE>
<ROUTINE_DEFINITION>CREATE PROCEDURE dbo.DeleteAplicacion ( @aplicacion char(10) , @nombrefichero varchar( 255 ) ) AS /* SET NOCOUNT ON */ DELETE FROM Ficheros WHERE Aplicacion = @aplicacion and NombreFichero = @nombrefichero RETURN 0</ROUTINE_DEFINITION>
</Table1>
- <Table1>
<USUARIO>[dbo]</USUARIO>
<NOMBRE>[DeleteAplicacionCompleta]</NOMBRE>
<ROUTINE_DEFINITION>CREATE PROCEDURE dbo.DeleteAplicacionCompleta ( @aplicacion char(10) ) AS /* SET NOCOUNT ON */ DELETE FROM Ficheros WHERE Aplicacion = @aplicacion RETURN 0</ROUTINE_DEFINITION>
</Table1>
- <Table1>
<USUARIO>[dbo]</USUARIO>
<NOMBRE>[DeleteID]</NOMBRE>
<ROUTINE_DEFINITION>CREATE PROCEDURE dbo.DeleteID ( @id integer ) AS /* SET NOCOUNT ON */ DELETE FROM Ficheros WHERE ID = @ID RETURN 0</ROUTINE_DEFINITION>
</Table1>
</NewDataSet>
Jan 11 '07 #1
1 1477
I found some way

see code.

For i = 0 To dsdatos.Tables(0).Rows.Count - 1

Dim NombreProc As New String(dsdatos.Tables(0).Rows(i).Item("NOMBRE").To String)
NombreProc = NombreProc.Remove(0, 1)
NombreProc = NombreProc.Remove((NombreProc.Length - 1), 1)

consult = "IF EXISTS(SELECT name FROM sysobjects WHERE name = '" & NombreProc & "' AND type = 'P') " & _
"DROP PROCEDURE " & (dsdatos.Tables(0).Rows(i).Item("USUARIO").ToStrin g) & "." & (dsdatos.Tables(0).Rows(i).Item("NOMBRE").ToString )
vdato = dsdatos.Tables(0).Rows(i).Item("ROUTINE_DEFINITION ").ToString
BD.EjecutarConsultaSQL(consult)
BD.EjecutarConsultaSQL(vdato)
Next

MsgBox("Importacion realizada correctamente", MsgBoxStyle.Information)
Catch ex As Exception
MsgBox("Error en la importación del fichero")
MsgBox(ex.ToString, MsgBoxStyle.Critical)

End Try
Jan 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Manlio Perillo | last post by:
Hi. I'm a new user of Python but I have noted a little problem. Python is a very good language but it is evolving, in particular its library is evolving. This can be a problem when, ad example,...
3
by: Doug Baroter | last post by:
Hi, One of my clients has the following situation. They use Access DB for data update etc. some business functions while they also want to view the Access data quickly and more efficiently in...
2
by: jet | last post by:
Hi, Maybe this is an easy task, but I'm having a really hard time figuring out how to do this. I'm a complete newbie to SQL Server. I have a database dump file from MySQL that's in .sql...
1
by: Chris | last post by:
Background: I am using a MS Access 2000 front end with SQL Server 8.0 back end. I have the requirement to import all text files (regardless of filename) from a given folder on the network into a...
3
by: Szaki | last post by:
I must import some exemplary file to database (MS Srrver 2000) ofcourse using procedure Transact SQL. This file must: 1.Read the xml file 2. Create table 3. Import this date from xml file to my...
1
by: mark | last post by:
In Access 2000 and 2002, I have created an import specification to import the fixed-width recordset below into an existing table. I am having strange problems with the import of the date and time...
6
by: Vladislav Moltchanov | last post by:
I have discovered a couple of years ago, that import with DoCMD.TransferText for CSV text file doesn’t work in Acc2000, while it works perfectly in ACC97. which has been discussed on this...
1
by: Child of His | last post by:
I have been through every trick I know, or has been suggested. I have a one to two million line fixed field database in text format. I want to bring it into Access 97. When I use the external...
4
by: IsValidUN | last post by:
I have an XSD which has an import to an XSD located on the web which has a DTD within it. (Using VS-2005 2.0 framework) If I load the XSD using the following, it can't find elements defined within...
16
by: giandeo | last post by:
Hello everybody I am trying to import an excel file for days into MS SQL Server 2000, unfortunately, I cannot see a ray of hope till now. I have surfed the WEB for hours, but again no...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.