|
Can anyone please help.
Thanks.
VB Prog
|
|
|
|
|
Hello everyone,
I have a function that recieves a filepath to a XML file and a XML Schema. I need to load my XML file into a Dataset if it matches the schema.
I then need to write the XML into a database. Can somebody please give me an example of how to do this. A simple XML file with a simple schema and an equally simple data base with a few tables would be great. As soon as is possible. I just need to see an example and I can go from there.
Many thanks
-ukfrosty
|
|
|
|
|
This really isn't a good article, but it might help you out.
RSS News Reader
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
I 'm making a project, and i need to make it well, so i want to manage exceptions well
I mean to make a message for each error, and i want to write message in French not in English, so what I should do?
I need to check data types (int - string ...) because the user can add a float in a case of integer and a string where he should enter a number...
I need to check the date format because the user can use the US or the UK system dd-mm-yyyy or mm-dd-yyyy or else.
I need to manage the errors by the application like the division by zero and else.
Thanks for help.
|
|
|
|
|
hi lord,
write ur code between following block
Try
'Write your code here
Catch ex as exception
msgbox ex.message
End try
from above code u can able to handle any type of exception.
Now call following function at keypress event of Textbox so the user must be enter proper value
// For accept only Text & white Space pass "e" ( one of the argument of keypress event) to this function
Public Sub CheckPressedKeyText(ByVal key As System.Windows.Forms.KeyPressEventArgs)
If Not (Char.IsControl(key.KeyChar) Or Char.IsLetter(key.KeyChar) Or Char.IsWhiteSpace(key.KeyChar)) Then
key.Handled = True
End If
End Sub
// For accept only numeric value with "." pass "e" ( one of the argument of keypress event) and "sender.text" to this function
Public Sub CheckPressedKeyNumericWithDot(ByVal key As System.Windows.Forms.KeyPressEventArgs, ByVal str As String)
If str.Contains(".") Then
CheckPressedKeyNumericWithoutDot(key)
Else
If Not (Char.IsControl(key.KeyChar) Or Char.IsNumber(key.KeyChar) Or key.KeyChar = ".") Then
key.Handled = True
End If
End If
End Sub
// For accept only numeric value without "." pass "e" ( one of the argument of keypress event) to this function
Public Sub CheckPressedKeyNumericWithoutDot(ByVal key As System.Windows.Forms.KeyPressEventArgs)
If Not (Char.IsControl(key.KeyChar) Or Char.IsNumber(key.KeyChar)) Then
key.Handled = True
End If
End Sub
for date, use DateTimePicker & set format property to "Custom" and then set Custom format property to ur choice.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
hello again
thanks man ...
now if i used the try ... catch ex msg(ex.msg) end try
i can't specify the error
in meaning of: if a procedure does not exist in the DB ... or if we have division by zero how to specify my msg to show ...
i want to send the folowing msg :
1- if division by zero : msgbox("Tu as fait une division par zero")
2- if connection broken : msgbox(" il y a eu une coupure de connection")
u see ... i need to take in consideration some execptions
thanks 4 help again
|
|
|
|
|
hi lord
use this one for division by zero
try
' write code here
Catch ex As DivideByZeroException
msgbox("Tu as fait une division par zero")
end try
& for connection broken exception , presently i have no more idea but u can handle it manually( according to where this exception may occur)
try following one
Catch ex As data.
Catch ex As oledb
Catch ex As odbc
Catch ex As DataException
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
ok man
i can found it
it's sqlclient.*
but that i c that i sould make catch for each exception !!!!
is this right ?
|
|
|
|
|
yes, if u want to show your own message to user (not .net generated message). otherwise it is not essential.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
thanks man
i got the msg
i'll start writing
but i think i have to write southand of lines
|
|
|
|
|
First of all, code that's wrapped in hundreds of try/catch statements is bad code. You should first check, for example, if you may be about to divide by zero. You should use int.tryparse,double.tryparse, etc, to see if a string contains the value type you expect. You should allow casting from double to int, unless you have special reasons not to.
An exception should be, well, exceptional. It shouldn't be something that you expect to happen in normal flow.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
so man
can u give me an example of error handeling
where there is more than one exception
thanks
|
|
|
|
|
Hi All,
I want to get a reference to a control on a form given the form name and the
control name as strings. For example I want to set the enabled/visible
properties of say "mnuExit" control in "frmMain" at run time ("mnuExit" and
"frmMain" are strings retrieved from a database). GetObject function
doesn't seem to work saying "Cannot create ActiveX control". Is there a way
to do this?
Thanks in advance
Regards Ganesh
PULSARS
|
|
|
|
|
Are you trying to get a reference to a control in your own app, or is this trying to get to a control in another application? BTW, GetObject is useless in both situations.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I am trying to get reference to a control from my own app. If GetObject won't work what else I can do?
Thanks in advance
Regards Ganesh
PULSARS
|
|
|
|
|
is this vb6? if so and assuming your asking for this within the same project, the only way to associate a string to an object is go through the collections.
first start with the forms collection then go through the control collection
dim oFrm as Form,oCtrl as control
For each oFrm in Forms
If oFrm.Name = "mnuMain" Then
For each oCtrl In oFrm.controls
If oCtrl.Name = "mnuExit" Then
oCtrl.enabled=true
oCtrl.visible = true
Exit For
End If
Next
Exit For
End if
Next
|
|
|
|
|
Thanks for the reply. I am using VB.NET 2005
I have a control called mnuExit in MenuStrip1 in FrmMain. When I try to iterate through the controls collection in FrmMain I only get reference to MenuStrip1 and not to the control mnuExit. However, when I work with the form in IDE I get reference to FrmMain.mnuExit. Is there a way to get reference to FrmMain.mnuExit through direct iteration?
Thanks in advance
Regards Ganesh
PULSARS
|
|
|
|
|
You have to enumerate the children of controls too, nut just the controls in the Form's Controls collection.
This would probably be best done with a recursive solution. If a control has children, the function calls itself with the current control.
|
|
|
|
|
I'll try that.
Thanks for your time
Regards Ganesh
PULSARS
|
|
|
|
|
Hello All,
Iam using Webbrowser control in VB6. I need to prevent 'F5' Key and also "Right-Click" menu in Webbrowser control.
And While print the html content in Webbrowser control using VB6.
I need to print the html content without Header and Footer of Webbrowser control.
Please give me some ideas...
Thanks & Regards
Kumaran
|
|
|
|
|
For the 'F5' part...turn on keypreview of the form and trap it in the keydown event of the form and if 'F5' then ignore the key.
Not sure about the mouse...
|
|
|
|
|
i want to connect ADO datacontrol, when i try to select the Server it gives me an error message
("Error enumarating data servers" enumarator data reports" unspecified error)
Vuyiswa
|
|
|
|
|
You can Google for "error enumerating data servers"[^] (with the quote marks!) to start trouble shooting the problem. There's a bunch of possible causes, dependant on the database server you're trying to use and what's installed on your machine.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Am redesigning the application that was written by other programmer who left the company.there is no documentation. am just looking at his and redisigning the application. the application has datagrid, i have change from Ms Access to Microsoft sql, when i run my new application checking on the datagrid result, this is what i get.
"Subscript out of range" and mark this Column yellow"
datagrid1.Columns(3).Width = 1820.
what would be the cause ?
and what should i have in mind while editing the datasource from access to Sql?
Vuyiswa
|
|
|
|
|
You are trying to access a column that doesn't exist. The data source returns less than four columns.
---
single minded; short sighted; long gone;
|
|
|
|