Visual Basic Development Bookmark and Share   
 Home > Visual Basic General > Read XML data in VB.NET from SQL Server (xml datatype column)
 

Read XML data in VB.NET from SQL Server (xml datatype column)

Hi all,

I would like to know if anybody can help me or give me an example how to work with XML.

I need to create an multilingual application and need to save the controls captions in sql table with xml data type

i started the following:

CREATE TABLE Windows(
ID [int] IDENTITY(1,1) PRIMARY KEY NOT NULL,
Form nvarchar(50) NULL,
List xml NULL
)


DECLARE @itemString nvarchar(max)
DECLARE @itemDoc xml

SET @itemString = '<Root>
<data name="btnExit">
<value>Exit</value>
</data>
<data name="btnLogin">
<value>Login</value>
</data>
</Root>'

SET @itemDoc = @itemString

INSERT INTO dbo.Windows SELECT 'frmLogin', @itemDoc

I know this is not very professional but thats all i did until know in SQL

Now i have a problem in VB.NET i don't know how to read an xml data type (How to get the value from variables).

If somebody can give me an exmaple how to read the xml than i would continue translating for each objects in the form where name is like the variable "btnLogin" and give it the controls.text property to the variables value.

Sorry for my bad english

Any help is welcome

Thx in advance!



Askenda  Friday, December 26, 2008 10:30 AM
Followingsite will explain all the detail fromxml datatype column

http://msdn.microsoft.com/en-us/library/ms971534.aspx
Gaurav Khanna
Khanna Gaurav  Friday, December 26, 2008 1:51 PM
Followingsite will explain all the detail fromxml datatype column

http://msdn.microsoft.com/en-us/library/ms971534.aspx
Gaurav Khanna

Do you know any other site with vb.net samples?
Askenda  20 hours 14 minutes ago
Khanna Gaurav  20 hours 5 minutes ago
here is the sample in VB.NET, u can find a neat explination for each and every statement...



and also download the below document sure it will help u a lotz, u can learn many more with XML data type in SQL Server
XML Support in Microsoft SQL Server
------------------------------------------
http://download.microsoft.com/download/f/1/c/f1cf7b8d-7fb9-4b71-a658-e748e67f9eba/XML_Support_in_SQL.doc


hope it helps...



Narayanan Dayalan - Zeetaa Business Solutions ------- Please "Mark As Answer", if my answer works well with ur Query
Narayanan Dayalan  19 hours 59 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• Customizing a details view for better data input.
• Communicating From DLL to .EXE that Created DLL Instance
• Sending mail via outlook
• Circle clips when drawn
• Creating dynamic flash or mpeg files with ASP or VB.net
• Application Error when running a VB program from the server
• copy all files on disk1 to disk 2 / How do I copy files that are in use by another process?
• Outlook Automation Type Casting in VB.NET
• Trying to print a text file to non default printer.
• can Serial device data be transmit to web_page.aspx directly?