|
I cant figure out how to use ado.net,
can be posible an example have the book for it i just cannot understand, i tried every thing but it doesn't work at all, I am still use the vb6.0 then the net
|
|
|
|
|
To start with, ADO and ADO.NET have very different approach.
ADO in vb6 is autometed at most when compared to ADO.net
Converting vb6 programs to vb.net is not very practical at most....
ok, ok! ok so! its not really effective and really difficult!
You need to understand how ADO.net captures data. read a lot of references or search and download "PDF files" using IMESH. (the best way to gather references")
You need 4 kind objects
1 connection
2 dataadapter
3 Command
4 Dataset
A Dataview can be used for further processing.
Marvin N. Guerrero
- Casting More!!
|
|
|
|
|
Hi, I have created a console application,and I am refering couple of DLL's in it. I made it into a setup package and installed in another machine, it ran well. When i installed on our network server and tried to run it. It did not run, it gave security.policy exception. Eventhough i have full control over the folder in the network i dont know why i cant run the application installed in the server from my machine. CAn anyone help me. If what i am doing is wrong I would appreciate if anyone can tell me the method of installing it properly on the network server.
Thanks
|
|
|
|
|
That's how it works. .NET applications running from network drives run in a sandbox. The easiest way to work around this is to copy the command line program to the local hard drive where you want to run it. If that is not acceptable, you will have to muck around with .NET security policies, and decide the best way to grant full permissions. There is a bit of a learning curve, so if you can just copy to the local drive, you will be better off!
|
|
|
|
|
I want to create a form such as a dialog box or a user control having return value
how can i do it
(for creating a dialogbox such as inputbox i defined a public variable and
in fact i did not have return value but i save return value that user enterde in the my inputbox in this public var)
thanx for your helps
|
|
|
|
|
Best way to do it is to set a public property or variable. There are no return values such that your see in a Function statement.
RageInTheMachine9532
|
|
|
|
|
Calling a Form using the ShowDialog method, you can return a DialogResult value.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
you can make a function is a module that shows a form as modal and returns the value from it.
|
|
|
|
|
You can use a Shared Variable in the form class that will hold the value to be returned.
"I think there is a world market for maybe 5 computers"
Thomas Watson, chairman of IBM, 1943
"There is no reason anyone would want a computer in their home"
Ken Olson, chairman & founder of Digital equipment, 1977
"This 'telephone' has too many shortcomings to be seriously considered as a means of communication. The device is ingerently of no value to us."
Western Union internal memo, 1876
"640 K ought to be enough for anybody."
Bill Gates, 1981
"Computers in the future may
|
|
|
|
|
Hi
Tanx but I couldn't undrestand what u mean
please descibe your solution.
|
|
|
|
|
create a form (frmMessageBox) and a module (mdlMsgBox)
in the mdlMsgBox create a Function :
public function MyMsgBox() as integer
frmMessageBox.Show vbModal
MyMsgBox = frmMessageBox.ReturnValue
end function
where ReturnValue is a public Get property (read only) of the form.
|
|
|
|
|
Hi
Tanx but I couldn't undrestand what u mean
please descibe your solution.
|
|
|
|
|
Try this
1st dim your second form from your main form.
2nd In the second form user will enter data into any object (text rdo...)
3rd exiting the form will be "me.hide".
4th control is then back to the main form at which point you can read the values that are in the objects of the second form.
ex;
Dim findEntry As New frmSearch
findEntry.ShowDialog() 'Form is shown. Used to set variables for search
If findEntry.DialogResult <> DialogResult.Abort Then ' Do search when true, = Abort when cancel btn clicked
sSearchText = findEntry.txtSearchText.Text
sSearchItem = CStr(findEntry.cboItems.SelectedItem)
findEntry.Close()
sSearch is a variable which is assigned the value from the second form.
Last step is to close the second form.
|
|
|
|
|
Do you mean values to be return from a form where you put values, then when you close will return a value to be available at the next form?
Please elaborate what particular return values you want, I may help you about this matter..
|
|
|
|
|
One of the features that I really like about Visual Basic .NET is the ability to declare ReadOnly arrays of value types. However, use of this feature can cause Visual Basic .NET to emit an invalid assembly.
To demonstrate what I'm talking about, let's construct a simple lookup table. The table in question maps integers to doubles and strings, never changes, and does not have an available formula to allow calculations.
Because the LUT needs to be available from launch, a ReadOnly array is created.
<br />
Public Structure LUTItem<br />
Dim D As Double<br />
Dim S As String<br />
Sub New(DValue As Double, SValue As String)<br />
Me.D = DValue<br />
Me.S = SValue<br />
End Sub<br />
End Structure<br />
<br />
Public ReadOnly LUTS() As LUTItem = { _<br />
New LUTItem(0.03,"A number"), _<br />
New LUTItem(0.91,"Another number" }<br />
For small arrays, this works wonderfully. However, when you pass around 30,000 items in your array, two things happen:
1) Visual Studio .NET gets heinously slow after every change to the file as it recompiles the file.
2) When you build, the build is successful, but when you run, you are told that the assembly is not valid.
So, my question is this: why is there a disconnect here?
If this particular structure is invalid for the runtime, why does it compile without errors or warnings?
If this particular structure is valid for the runtime, why does the CLR call it an invalid assembly?
Note: I know that creating a massive LUT that way in the assembly is poor coding style. However, when porting software, it is often easier to do a straight port first, then enhance later. I encountered this porting a C++ library to VB.NET when I moved over a 48,000+ element array of structs used in the code that included function pointers and data to pass to the function pointers. Because it was a const array, I was trying to keep a similar access modifier in case any changes I made to the library inadvertently changed values in the array. Besides, who wants to create 48,000+ delegates while loading a file?
|
|
|
|
|
If all you have in this table is key and value pairs, why not implement it as a Dictionary using the DictionaryBase class? You can make your Dictionary ReadOnly and provide Insert Validation.
RageInTheMachine9532
|
|
|
|
|
The example was a simplified version of the actual port work. The example has problems after 30,000 entires, as does the actual port work, which has 11 seperate properties, including three delegates.
As for your recommendation, I do agree. That would be preferred were it possible.
However, there are strengths to using a ReadOnly array, namely compile-time array write checking rather than runtime checking, increased performance, and strong typing without a wrapper class.
But the main issue here is which is wrong: the compiler compiling code that should not run, or the CLR crashing on code that should?
|
|
|
|
|
Howdy,
I have a project that adds a dynamic context menu to Windows Explorer. I right click on any file and my menu items are displayed just fine.
However, when I right click a file in My Computer - no menu.
My registry settings appear to be just fine - they are the same as other context menu utilites.
I have restarted explorer.exe and even re-booted the computer
I am implementing CMF_EXPLORE in QueryContextMenu. Is there another interface I should be implementing in my code?
Any ideas why this works in Windows Explorer but not My Computer?
Thanks
- Brad
|
|
|
|
|
VB6:
Hi
in my user control code I want to pass the user control to a standard module sub but I'm having troubles with this :
'module : mdl.bas
Public Sub Add(ctrl As UserControl)
MsgBox ctrl.Width
End Sub
'MyCtrl.ctl
Private Sub Command1_Click()
Add Me
End Sub
I get this error : Type Mismatch because Me type is considered MyCtrl not userControl
then i tried this :
'module
Public Sub Add(ctrl As MyCtrl)
MsgBox ctrl.Width
End Sub
but i get : Method or data member not found ..
any way around this ?
|
|
|
|
|
On what line are you getting this error?
I'm guessing your getting on the 'Add Me' line. This would be because Add is not defined in your Control anywhere. You might want to try 'md1.Add Me'...
But, a better design would be for something outside the control to call the add function with a reference to the control.
RageInTheMachine9532
|
|
|
|
|
mdl.Add Me did not work when the Add method was defined as :
Public Function Add(ctrl as UserControl)
not specifying the module name (mdl) does not make the problem..
|
|
|
|
|
I didn't think it would, but it was worth a try...
The best method is still to have a piece of code outside your control add the control to your collection.
RageInTheMachine9532
|
|
|
|
|
Hi
i solved the (Sub not found) problem by exposing the user control properties using public properties.
thank you.
|
|
|
|
|
Is anyone familiar with using TTS with DirectSS? I was following an older tutorial on here, (http://www.codeproject.com/vbscript/texttospeech.asp), and like many of the other users pointed out, I am having trouble hearing any sound. I added the DirecSS component which is linked to the c:\windows\speech\XVoice.dll The program compiles, and there are no errors with the speech class. Vb recognizes:
spkSpeak.Speak("whatever")
and
spkSpeak.Speak(txtText.Text)
the second line there should speak what is typed in a text field named txtText. Any ideas as to why there is no sound?
I am using XP, and this tutorial was written before XP I believe, not sure if there is a compatability issue?
Thanks for any help!
|
|
|
|
|
Hi,
I couldn't find any information for the above topic, so I post it here.
I am trying to deactivate/disable the Floppy Disk Device under XP via Visual Basic. I already found out that it's not possible with WSH.
Is there any Api Function which allows me to disable the controller?
I need this to temporarily disable the Floppy to use the substitute Command to redirect the disk access to a directory. The SUBST command only works when a:\ isn't available!
Any suggestion to help me?
Thank you very much in advance for your replies.
Monivong
|
|
|
|