|
Its hard to give an example without knowing what the XML data is, that said, below is an example that will create an x-path navigator for XML data taken from a string variable:
Dim sReader As New IO.StringReader(My_XML_Text_string)
Dim xDoc As New Xml.XPath.XPathDocument(sReader)
Dim xNav As Xml.XPath.XPathNavigator = xDoc.CreateNavigator()
The variable My_XML_Text_string contains your XML data....
At this point you can navigate through the XML nodes and attributes using the xNav instance
Regards,
Martin
|
|
|
|
|
Way is fine but Error I am receiving is same,
Same in case of XmlDocument.
Error "Root Element is missing"
|
|
|
|
|
It would seem there is a problem with your XML data and not your programming. The Root Node from your XML data is missing -- what is your XML data??
Martin
|
|
|
|
|
hi, i have a windows application. in load event of my form i retrieve data from " Microsoft Access" database.
when i build or run form,i see several Error MessageBox with this content : "object reference not set to an instance of an object ".
after that i submit these,Program Runs Successfully!!
what is my problem?
thanks
|
|
|
|
|
Your main problem appears to be that you can't decide what account to post with, or what language you're using. Or did a different user just happen to post the exact same question in the C# forum ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Dear Christian Graus
I am programmer with both C# and VB
It happened many times ,i Asked my problem in both C# and VB forums and i accept my answer in only one of theme.
Thanks
|
|
|
|
|
That message means you tried to set a property or call a method on a class that wasn't instantiated. The most common cause is that you assumed you'd get back an object from some kind of query, but instead, you got back Nothing and tried to use it or make some modification to it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you MR Dave Kreskowiak
|
|
|
|
|
Hi,
I have created 2 simple projects, one executable and one dll. The exe has a reference to the dll.
When I try to compile the dll (TEST TWO.vbproj) from a batch file the exe (TEST ONE.vbproj) is compiled also. Why does this happen? I thought I would have to issue another command to build the exe.
The batch file I use looks like
<br />
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0" /v InstallDir') DO SET InstallDir=%%B<br />
<br />
set mycommand="%InstallDir%devenv" /build Release /out "C:\BuildErrors.log" ".\TEST TWO\TEST TWO.vbproj"<br />
echo %mycommand%<br />
<br />
@call %mycommand%<br />
<br />
pause<br />
If anyone can suggest a nicer way of finding out the Visual Studio installation path I'd be very grateful.
Thanks very much,
dlarkin77
|
|
|
|
|
Have you considered using MSBUILD instead of using the Visual Studio environment? As I understand it, visual studio just uses MSBUILD underneath the covers anyway.
It can be accessed from the following path:
%windir%\Microsoft.NET\Framework\v2.0.50727
|
|
|
|
|
Thanks for that info Colin. I started looking at MSBuild but I got totally sidetracked with NAnt.
I've been playing around with it and it looks pretty good. But whenever I try to build a Windows Forms application the XP Visual Styles are being lost. Can anyone tell me what I need to do to keep the xp styles?
The build file I use is below:
<code>
<?xml version="1.0" encoding="Windows-1252" ?>
<project name="TESTER" default="run" xmlns="http://nant.sf.net/release/0.85/nant.xsd">
<property name="basename" value="TESTER"/>
<property name="debug" value="true"/>
<property name="build.dir" value="bin"/>
<namespaceimports id="tester.imports">
<import namespace="Microsoft.VisualBasic" />
<import namespace="System" />
<import namespace="System.Collections" />
<import namespace="System.Data" />
<import namespace="System.Diagnostics" />
<import namespace="System.Drawing" />
<import namespace="System.Windows.Forms" />
</namespaceimports>
<target name="build">
<mkdir dir="${build.dir}"/>
<vbc target="winexe" output="${build.dir}/${basename}.exe" debug="${debug}"
main="TESTER.frmMain"
optioncompare="text"
optionexplicit="true"
optionstrict="true"
rootnamespace="TESTER"
removeintchecks="true">
<imports refid="tester.imports" />
<sources>
<include name="*.vb" />
</sources>
<references>
<include name="System.dll" />
<include name="System.Data.dll" />
<include name="System.Drawing.dll" />
<include name="System.Windows.Forms.dll" />
<include name="System.Xml.dll" />
</references>
</vbc>
</target>
<target name="run" depends="build">
<exec program="${basename}.exe" basedir="${build.dir}" />
</target>
</project>
</code>
Thanks very much,
dlarkin77
|
|
|
|
|
What is the simplest way to update or add data with a DataSet?
My Dataset contains various tables with relations, I want a way to update my datasource according to all the changes that has taken place on my dataset (changes made by means of data-bound controls).
As far as I now System.Data.DataSet.AcceptChanges() does this, updating both the DataTables' and the DataRows' data to the datasource.
My problem is that when I add a control (eg. TextBox) to my form and setup it's DataBinding, it doesn't seem to communicate with the DataSet, so when I type something in that field and execute AcceptChanges() it doesn't update my datasource.
The control's databinding is setup to a BindingSource which has my dataSet as Source.
What does work is to do a BindingSource.EndEdit() for a specific DataTable and then a TableAdapter.Update() but this seems to update the datasource as well and totally bypasses the "global update" functionality I hope to obtain by using the Dataset.AcceptChanges() method.
you can't forget something you never knew...
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
note on virtual execution system
thank you
|
|
|
|
|
Was that meant to be a question ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
What are you talking about? Are you asking about "virtual machines"?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Sir/Madam,
I am creating the table programically .In the query like
dim sql as string = "create table tablename(field1,text)
After creating the table.I am getting the Memo Field instead of text.all i want is field1 should have text type with some length.But i am getting memo type of field1 in table.
Please help.
Thanks and Regards
Pankaj
|
|
|
|
|
Hi Pankaj,
If I understand you correctly, you are either getting what you want, or you are using the wrong type. In some databases text = memo, in a sense it is type NVARCHAR, but with the maximum length for such a field. If you want to create a field that can contain text of a certain length, you should use:
create table tablename(field1, NVARCHAR(x))
where x is some number.
I hope that answers your question,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
|
Sir/Madam,
I wanted to know the difference between integer and int32 .Basically in which situations we should use integer and in which situations we should use int32.
Thanks and regards
Pankaj Garg
|
|
|
|
|
Please don't ask twice.
Your question has nothing to do with intptr. There are no situations I can think of where I'd use one over the other, in fact, I use int all the time, I'm not sure they are different ( unless int is not 32 bit, but I assume it is )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Sir/Madam,
I am sorry .Actually by mistake the title of the problem is written wrong.Next time i will take care of it.
Thanks and Regards
Pankaj
|
|
|
|
|
There is no difference between Integer and Int32. Integer is the VB.Net alias for a System.Int32, a 32-bit signed integer.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
It is best to only use types such as int32, int16 etc. when you need to guarentee a certain number of bits are used to store a value (whether that be numerical, bit flags, or just encoded data of a proprietory type).
If you generally dont care how many bits it takes to store the value use a basic type, such as integer, long etc.
The general purpose, from my point of view, for types such as int32 is to ensure portability of code across several platforms (as I mention above e.g. -- if you are using the bits in a variable to flag information you may need to ensure you have a minimum of 32 bits -- using a basic type like integer does not mean you will necessarily have a 32bit variable, although in the case of .Net this is actually true).
Regards,
Martin
|
|
|
|
|
Sir/Madam,
I want to know the meaning of Intptr.
Dim a as Intptr.
I mean to say that What is the utility of intptr.
Thanks and Regards
Pankaj Garg
|
|
|
|
|
An intptr is a pointer. It's the type used to pass pointers where needed, such as a windows handle.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|