Click here to Skip to main content
15,920,632 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionget hardware serial no.for software Pin
kamal prajapati9-Nov-11 0:15
kamal prajapati9-Nov-11 0:15 
AnswerRe: get hardware serial no.for software Pin
Wayne Gaylard9-Nov-11 0:27
professionalWayne Gaylard9-Nov-11 0:27 
AnswerRe: get hardware serial no.for software Pin
Richard MacCutchan9-Nov-11 2:17
mveRichard MacCutchan9-Nov-11 2:17 
QuestionResizing image from SqlServer BLOB column to fit into a picturebox Pin
rangachisi7-Nov-11 5:22
rangachisi7-Nov-11 5:22 
AnswerRe: Resizing image from SqlServer BLOB column to fit into a picturebox Pin
Luc Pattyn7-Nov-11 5:38
sitebuilderLuc Pattyn7-Nov-11 5:38 
GeneralRe: Resizing image from SqlServer BLOB column to fit into a picturebox Pin
Dalek Dave8-Nov-11 11:07
professionalDalek Dave8-Nov-11 11:07 
GeneralRe: Resizing image from SqlServer BLOB column to fit into a picturebox Pin
Luc Pattyn8-Nov-11 11:19
sitebuilderLuc Pattyn8-Nov-11 11:19 
QuestionHaving trouble with XmlWriter class Pin
Dominick Marciano3-Nov-11 19:36
professionalDominick Marciano3-Nov-11 19:36 
I wrote an XML schema in Liquid XML Studio Developer Edition. I had the software create a sample XML file based on the schema and now I'm trying to write a VB application that will create a valid XML file. I can get the entire XML file to write properly, except for the root element, which cause the file to not validate.

In the sample XML file that was created based on the schema, the root element looks like this:
VB
<mycompany:RawData xmlns:mycompany="http://www.lewcorp.com/2011/RawJbxSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mycompanywebsite.com/2011/RawDataSchema" UnitType="Commons" version="string" MinVersionRequired="7">


The code I currently have is this:

VB
Using writer As XmlWriter = XmlWriter.Create(XMLFileName, settings)
            With writer
                .WriteStartDocument()
                .WriteStartElement("lew")
                .WriteAttributeString("xmlns", "mycompany", "", "http://www.lewcorp.com/2011/RawDataSchema")
                .WriteAttributeString("xmlns", "xsi", "", "http://www.w3.org/2001/XMLSchema-instance")
                .WriteAttributeString("xsi", "schemaLocation", "", "http://www.mycompanywebsite.com/2011/RawDataSchema")
                .WriteAttributeString("UnitType","Commons")
                .WriteAttributeString("version", "1.0")
                .WriteAttributeString("MinVersionRequired", "7")


However that produces this:
VB
<mycompany xmlns:mycompany="http://www.lewcorp.com/2011/RawDataSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://www.mycompanywebsite.com/2011/RawDataSchema" UnitType="Commons" version="1.0" MinVersionRequired="7">


I have tried modifying the lines that write the attribute strings for the past hour and can't get it to match. There are two items that I can't figure out. First is why the schemaLocation does not have the xsi prefix. However the main thing that I believe is causing my XML file to not validate is the fact that the root element mycompany does not have the suffix of RawData.

I will admit that this is the first time I'm using the XmlWriter but I just can't find anything online and don't exactly know what to search to fix. Although it seems that what I'm trying to do is not absolutely necessary, my company wants it that way because eventually we are going to have several different schemas that will mark various stages of data analysis (for example we might have mycompany:RawData, mycompany:Reviewed, mycompany:Merged). Plus we very often share data with other companies so we also want our name in there.

Any help would be greatly appreciated. Thanks in advance.
Questionto get unique serial no of hardware devices Pin
Pratik Sagar2-Nov-11 18:19
Pratik Sagar2-Nov-11 18:19 
AnswerRe: to get unique serial no of hardware devices Pin
Richard MacCutchan2-Nov-11 21:56
mveRichard MacCutchan2-Nov-11 21:56 
AnswerRe: to get unique serial no of hardware devices Pin
David Mujica3-Nov-11 2:41
David Mujica3-Nov-11 2:41 
GeneralRe: to get unique serial no of hardware devices Pin
Richard MacCutchan3-Nov-11 3:06
mveRichard MacCutchan3-Nov-11 3:06 
GeneralRe: to get unique serial no of hardware devices Pin
Dave Kreskowiak8-Nov-11 3:06
mveDave Kreskowiak8-Nov-11 3:06 
GeneralRe: to get unique serial no of hardware devices Pin
Richard MacCutchan8-Nov-11 5:39
mveRichard MacCutchan8-Nov-11 5:39 
GeneralRe: to get unique serial no of hardware devices Pin
Dave Kreskowiak8-Nov-11 13:13
mveDave Kreskowiak8-Nov-11 13:13 
QuestionRe: to get unique serial no of hardware devices Pin
Luc Pattyn4-Nov-11 2:28
sitebuilderLuc Pattyn4-Nov-11 2:28 
AnswerRe: to get unique serial no of hardware devices Pin
Richard MacCutchan8-Nov-11 5:40
mveRichard MacCutchan8-Nov-11 5:40 
QuestionVisual Basic Build Error Pin
X20402-Nov-11 4:40
X20402-Nov-11 4:40 
SuggestionRe: Visual Basic Build Error PinPopular
Clark Kent1234-Nov-11 2:12
professionalClark Kent1234-Nov-11 2:12 
GeneralRe: Visual Basic Build Error Pin
X204018-Nov-11 23:54
X204018-Nov-11 23:54 
GeneralRe: Visual Basic Build Error Pin
Clark Kent12321-Nov-11 2:12
professionalClark Kent12321-Nov-11 2:12 
AnswerRe: Visual Basic Build Error Pin
ct909267-Nov-11 3:55
ct909267-Nov-11 3:55 
SuggestionRe: Visual Basic Build Error Pin
chandanadhikari17-Nov-11 19:15
chandanadhikari17-Nov-11 19:15 
GeneralRe: Visual Basic Build Error Pin
X204018-Nov-11 23:53
X204018-Nov-11 23:53 
Questionerror in adding the reference of my web service in Visual Basic Pin
yousefshokati1-Nov-11 23:29
yousefshokati1-Nov-11 23:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.