|
This would normally be done in your SQL statement, something like
SELECT field list FROM table WHERE PartID = @PartID
You'd have to pass the ID that your looking for to the SQL stored procedure using a parameterized query. You can read up more on this and why it's a good idea in Colin Mackay's article, SQL Injection Attacks and Some Tips on How to Prevent Them[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am trying to get the LDAP root from a domain..
LDAP://DC=Company,DC=Com,DC=au
Found many apps that let me browse a LDAP structure but i want the root DC from the domain.
Can get the domain and was going to load into array and pull out each value building a string but this is not really the best and I hope someone has a better solution using the directory service .dll.
Dim mydomain as string()
'Get domain fill mydomain
'Loop through mydomain
Dim LDAPString as string
LDAPString = "LDAP://DC=" & Array1 & ",DC=" & Array2 & ",DC=" & Array3
Hope this makes sense.....
When people make you see red, be thankful you're not colour blind.'Get
|
|
|
|
|
'// I don't have AD Running here at the moment
'// to test this, but it should be
'// something like this:
Imports System.Runtime.InteropServices
Public Shared Sub dsRootPath()
Dim dsbi As New LibWrap.DSBrowseInfo
Dim return As Integer = LibWrap.DsBrowseForContainerW(dsbi)
' see DSBrowseInfo structure
Debug.WriteLine("Root Path: " & dsbi.rootPath)
End Sub
Public Class LibWrap
' Declares a managed prototype for the unmanaged function.
Public Shared DSBI_ENTIREDIRECTORY As Integer = &H90000
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure DSBrowseInfo
Public structSize As Integer
Public dlgOwner As IntPtr
Public dlgCaption As String
Public treeViewTitle As String
Public rootPath As String
Public path As String
Public pathSize As Integer
Public flags As Integer
Public callback As IntPtr
Public lParam As IntPtr
Public returnFormat As Integer
Public userName As String
Public password As String
Public objectClass As String
Public objectClassSize As Integer
End Structure
Declare Unicode Function DsBrowseForContainerW Lib "dsuiext.dll" ( _
ByRef info As DSBrowseInfo) As Integer
End Class 'LibWrap
Hope that helps
|
|
|
|
|
Thanks for this but I have some questions...
Created a new project and added a class where I placed your class code.
I put this code in the main form and called it on load. I had to change return to my return as it was not a valid identifier.
Public Shared Sub dsRootPath()
Dim dsbi As New LibWrap.DSBrowseInfo
Dim return As Integer = LibWrap.DsBrowseForContainerW(dsbi)
' see DSBrowseInfo structure
Debug.WriteLine("Root Path: " & dsbi.rootPath)
End Sub
In the class code the
<structlayout(layoutkind.sequential, charset:="CharSet.Unicode)"> _
Public Structure DSBrowseInfo
tells me the
|
|
|
|
|
Japel,
You'll need to add the line:
Imports System.Runtime.InteropServices
To the top of the class file also.
Hope this helps
|
|
|
|
|
I am trying to make an application that uses an array of dates. I used the following line to declare the array:
Dim List() As Date
However, when I add the dates to the array, time is also included e.g. 09/06/2005 12:00:00 AM
I need only the date part(i.e. 09/06/2005) to be added into the array, NOT TOGETHER with the time(i.e.09/06/2005 12:00:00 AM) .Someone please help me with a code example of how this can be achieved.
Thanks in Advance!
-- modified at 8:56 Monday 17th October, 2005
|
|
|
|
|
You can't really. The DateTime is a serial number that counts the number of ticks (100-nanosecond interval) from Midnight, Jan 1, 0001 to whatever the DateTime structure represents. What your seeing is the full string representation of that number. The number itself (see the Ticks property[^]) doesn't have seperate date and time components.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I should have added to my previous post that there are various methods to convert the DateTime structure to any format of Date and/OR Time. Checkout the .ToShortDateString() method of your DateTime object.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have tried that .ToShortDateString() method in the code below:
List(Index) = CDate(InputBox("Enter Date:")).ToShortDateString
lstDisplay.Items.Add(List(Index))
When I displayed the list(index) in a list box, it comes out as :e.g. 5/2/2005 12:00:00 AM.
NB/ The List array is declared as a date type variable.
I really need to omit the time part, however I am glad for at least getting a reply. I am still looking forward for a reply.
P.S. I can send the source code and a short description of what I am trying to achieve to anyone who needs a closer look at my problem.
Thanks in advance.
|
|
|
|
|
Instead of waiting, just play with the oject. Look at the documentation on MSDN, especially the formatting strings for the .ToString() method.
You might want to try something like this:
Dim myDateString As String = myDateObject.ToString("mm/dd/yyyy")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
is there a simpler object than the windows.forms.label that supports OnResize, OnPaint and Region?
I need to work with about 5000 instance of a class, i'm currently using label and its pretty - sloWW.
ThankS!
Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU
|
|
|
|
|
No, that's pretty much as simple as it gets. You could always just write your own control from scratch though. But, when you have that many controls on a form it's just going to be slow, period. Try, resizing the form with that many controls.
You might want to rethink your interface...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks.
I'm using the labels to draw vectors over a map. I used to to overlay building footprints on a jpeg within a picturebox. I used labels instead of drawing polygons (graphics.drawing) because i need to interact with the footprints - they must be clickable.
I guess i have to turn to some primitive datatype's because .net's Integers are too heavy.
Anyboy know how to use DirectX 9sdk? for vb.net.
thanks again.
Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU
|
|
|
|
|
Guerven wrote: I guess i have to turn to some primitive datatype's because .net's Integers are too heavy.
WHAT?? .NET Integer's are 32-bit (processor width), just like any other integer. What are you talking about?????????????????????????
Guerven wrote: I'm using the labels to draw vectors over a map.
Not a good idea. You'd be much better off tracking the points you need to draw in something, like an array of objects, then drawing them with the Graphics primitives. These objects can be controls of their own, inherit from Control or UserControl. You can still make them "interactable" if you supply the OnClick code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how to use paramarray in vb.net. Pls tell me good site for vb.net only
himanshu
|
|
|
|
|
It's usually used to pass an array of parameters to a Sub or Function. It's useful when you're method doesn't know the number of parameters will vary from call to call. You can find more information here[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
what is paramArray.how to use in vb.net.pls give me good site to find everything (vb.net only)
himanshu
|
|
|
|
|
Hello Friends,
I am currently developing one application using VB.NET & Access + Oracle as a databases, and I want to install it on client machine. Since, we can not say for sure, whether .NET Framework is already installed on clients machine. I don't want my client to install it manually/separately, instead the framework (if required) should get installed automatically. I want to make setup of my application in such a way that it will determine immidiately that .NET Framework should be installed before proceding to its own installation. (and obviously it shoud install it... )
Can anyone please suggest me how i should go about it???
Thannks in advance....
|
|
|
|
|
|
Hey Kalyan,
Thanks a lot.....
You have helped me exactly when I wanted....
Thanx once again....
Regards,
Rohan...
|
|
|
|
|
I have a textbox and a date time picker.
the text box is used to display the value choosen from the date time picker.
When the focus is on the textbox, if the user click the ENTER key, I want that the date time picker open, and the focus is on it so the user, by using the ARROW keys, can choose a date.
I know how to test the key pressed by the user, this is my code:
Private Sub dtpprofdate_DropDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles dtpprofdate.DropDown
Me.dtpprofdate.DropDownAlign = LeftRightAlignment.Right
Me.dtpprofdate.Focus()
End Sub
Private Sub txtdateproforma_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtdateproforma.KeyPress
If KeyAscii(e) = 13 Then
dtpprofdate_DropDown(sender, e)
End If
End Sub
IF the key is an ENTER key (KeyAscii(e) function make the checking)the DropDown event of the date time picker is fired.
But the problem is that the date time picker is not opening??
Any help
|
|
|
|
|
Hi
Does anyone have a document or URL that describes how to make a trial version of .Net application?
Thanks
|
|
|
|
|
There's all sorts of different ways. The way I did it was to put a registration key in my config file. If it's not there, then the app is the demo version.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I think that I cam help u in this.
you can write code that count how many time you open application
-----
Imports Microsoft.Win32
dim count as int
dim fcount as int
dim tra as int= //the number of opening appl u specify it
Dim MainKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software", True)
Dim MyKey As RegistryKey = MainKey.CreateSubKey("fcount")
========
count = MyKey.GetValue("fcount")
====code in form load
fcount++
if tra==fcount
Me.colse
-----------------------------
u may arrange this code to work will
AMR-CIS
|
|
|
|
|
Hi, question is it possible to have a left mouseclick on any of those 2 menus instead of a right mouseclick. If so be kind enough to show me. Thank you
|
|
|
|