|
Hey all,
I'm getting a really annoying error when trying to save my xml document. I was using the example from the MSDN and it failed to with the same error. Here's the current code:
Friend Sub upload()
'create xml doc
Dim XMLDoc As New XmlDocument
'get all controls from form1
Dim ctrl As Control = f1.GetNextControl(f1, True)
'if the control is a special type called unitbox
If TypeOf ctrl Is UnitBox Then
'set it to x
Dim x = DirectCast(ctrl, UnitBox)
'if unitbox.unittype falls in the case
Select Case x.unitType
Case "infantry"
Dim inf As XmlElement = XMLDoc.CreateElement("infantry")
inf.SetAttribute("number", x.number)
inf.SetAttribute("location", x.endcountry)
inf.SetAttribute("owner", x.owner)
'also tried xmldoc.appendchild(inf) to no avail
XMLDoc.DocumentElement.AppendChild(inf)
'more cases... all the same stuff though
End Select
End If
'gives a system error
XMLDoc.Save("testxml.xml")
End Sub
Thanks a for any help
Mike
Gaming at the GuildofBlades.com is the only way to really experiece the level 99 Soul-Sucking Sword!
|
|
|
|
|
What kind of error specifically? Is it an access denied error? You're telling it to save as testxml.xml. but what directory are you running in? Did you set the DocumentElement to something before appending children to it?
Logifusion[^]
If not entertaining, write your Congressman.
|
|
|
|
|
hi
i have a package developed in vb.net.how can i deploy the embeded crystal report of my project to the client machine using vb.net code?when ever i ll run my program in client machine it will ask for the login information from registry.bt from that registry value,how can i set the login information of reports that i already ve been developed in another machine having different server,password & database name.please explain it with an example
u can send me the source code at pradipta_pkc@indiatimes.com
any suggestion in this regard will be highly appreciated
thanking u all in advance
i m pradip kumar from india,working in vb.net & asp.net
i m pradip kumar from india,working in vb.net & asp.net
|
|
|
|
|
I need to capture the Ctrl+Shift+C keys even when my form does not have the focus (more like a service running without an interface).
Can anyone help?
Urgently needed
|
|
|
|
|
|
There are many ways,
1. using Timer and call GetAsyncKeyState
2. using MenuStrip
3. using contextmenustrip
etc...
http://justicemansoftware.tk
|
|
|
|
|
I find most article about this topic using c#,
does there any article in VB.NET ?
Or, There is no way in VB.NET ?
Many Thanks.
|
|
|
|
|
All you have to do is convert the C# code to VB.NET. I haven't found any VB.NET examples and, frankly, have no time to convert them myself.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
HY!
I'm using the AxWebBrowser component in my current vb.net project to be able to use my app as a browser! I want to switch off the internet explorer keyboard shortcuts, but I don't know how i can handle this with the AxWebBrowser tool. I know it's possible to do that with the standard vb.net 2005 WebBrowser tool in vb developer 2005 ->
WebBrowser1.WebBrowserShortcutsEnabled = False .
But there's a bug in the WebBrowser (navigating thru macromedia flash sites isn't possible http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=142772&SiteId=1[^]) component, so I have to use AxWebBrowser.
thx!
dusty
|
|
|
|
|
How Do I display pictures from a specified directory in a listview including the images not just their names.
Posted by The ANZAC
|
|
|
|
|
Use the ImageList for storing your images before displaying into the listview
http://justicemansoftware.tk
|
|
|
|
|
Yes I know this, the only issue is that the imagelist's items property is read only and images cannot be added programatically, is there anyway to sotre a virtual indexed list, like a string.
Posted by The ANZAC
|
|
|
|
|
How Do I find the current Desktop Background Image or it's path and Display it in a Picture Box on my form.
Thanks in Advance
Posted by The ANZAC
|
|
|
|
|
I was compacting and repairing my Database, and my Computer hanged, then I restarted it and after the restart I openned my database and could not find all my queries. Can anyone help me if its still possible to retrieve those lost queries.
|
|
|
|
|
More than likely not. Pretty much, the only thing you can do is another Compact and Repair. Don't you just love Access?!?!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
wrote: Don't you just love Access?!?!
|
|
|
|
|
I having this error when i run my function,i was thinking to change the value in my access while user click on it but Error message came out..? wat happen? the data i wanna update is either Yes/NO in access. Is it correct 0=NO, 1= yes in vb?
Run-time Error '91':
object variable or with block variable not set
Here is the coding have error:
DB.Execute "update dono set InvoicePrint=" & "'" & 1 & "'" & _
" where [NO] = " & "'" & Dorder.dono.Text & "'"
-- modified at 5:00 Thursday 10th August, 2006
|
|
|
|
|
Use a boolean variable and assign it "True" or "False" as necessary.
|
|
|
|
|
I have edit it but the same error pop up..??
Dim tick as boolean
If answer = vbYes Then
tick = True
DB.Execute "update dono set InvoicePrint=" & " tick " & _
" where [NO] = " & "'" & Dorder.dono.Text & "'"
Any mistake ?
|
|
|
|
|
i think you should try this
dim tick as string
if answer=vbyes then
tick = "true"
db.execute "UPDATE Dono SET InvoicePrint = " & tick & " WHERE [NO] = "'" & dorder.dono.text & "'"
mr_a_ghost@yahoo.com
|
|
|
|
|
i try it..not working... still having the same error......
|
|
|
|
|
usually that error raise because of we forget declaring new instance of an object in vb6
try this
...
dim DB as new adodb.connection, tick as string
if answer=vbyes then
tick="True"
db.connectionstring="provider=microsoft.jet.oledb.4.0;data source=c:\db1.mdb"
db.open
db.execute "UPDATE Dono SET InvoicePrint = " & tick & " WHERE [NO] = "'" & dorder.dono.text & "'"
end if
end sub
|
|
|
|
|
There is error:
Run time error'3704':
Operation is not allowed when the object is closed.
DB.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=c:\db1.mdb"
DB.opendb
-- modified at 23:51 Thursday 17th August, 2006
|
|
|
|
|
ups, my mistake, you should replace c:\db1.mdb with your database location, and you should use db.open instead of db.opendb methods, good luck
|
|
|
|
|
oh yes i did try that but when it run it said the "data type mismatch in criteria expression"
is it the value problem?? actually do u know wat is BIT stand for? i check on the data type for the check box in access is in YES/NO (BIT). normally others is Char/ interger wat is BIT?
|
|
|
|