|
I have a data table of which, one column has been made unique.
Datatable.Columns("ColumnName").Unique = True
This table has been assigned to a Datagrid. While running the application when unique constraint is violated it displays an exception massage. Is it possible to catch this exception massage and customize according to my wish?
|
|
|
|
|
Check
DataRow.RowError property,DataTable.HasErrors and DataRow.HasErrors properties
|
|
|
|
|
Emergency!!!!!!!!! Urgent help required please help me ,
I've been posting requests for 2 year but no one has replied to any of my post . This time it's urgent i am getting mad as it's my final year project's problem. I am developing a network simulator for this on the client side i need to disable user interaction with windows(98,2000,XP etc) I've tried many stuffs but fail to manage things , any one can help me how to stop user interaction with windows .
One solution might work , it is to load my client application before windows completely loads or ever log on.
But i donn't know how to do in vb.net please help me
|
|
|
|
|
Make it a windows service (inherit from the Servicebase class).
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
It's impossible to load your app before Windows starts. You'll have to write your app as a service. It'll load before the user logs on.
In order to completely stop the user's interaction with the Windows, you'll have to hook the keyboard and mouse and eat the those messages.
What do you mean by "network simulator"? And why do you have to disable user interaction?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Actually i want to Automate a small network with server having four clients , user will log on to my application if it starts (i can hope) before windows and will be granted access to system resources according to their user rights assigned by application running on the server side . To get certain rights and permissions user have to register themselves through main menu on client side . Like you may have seen cybercafe pro (a netcafe' manager at http://www.cybercafepro.com) Uer will not (rather souldn't ) be able to close my application (only admin) .
|
|
|
|
|
TheOnlyFalcon wrote:
my application if it starts (i can hope) before windows
Not even a chance in Hell.
TheOnlyFalcon wrote:
Like you may have seen cybercafe pro (a netcafe' manager at http://www.cybercafepro.com) Uer will not (rather souldn't ) be able to close my application (only admin) .
I seriously doubt they did it the way your envisioning.
Windows does support being limited to Kiosks. You can't complete all of this in code. You're going to have to use Group Policies to lock Windows down to do some of this. I would highly suggest picking up the Windows XP Resource kit for more information.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi all,
What I have working
I am working on a small Electronics CAD app in VB.net, I have a few classes that allow me to move objects around, as with any existing apps. I started this to improve my knowledge of object-oriented programming, so far I have a app that will allow objects to be created at run time, for e.g. I am creating a panel, you can create as many as you want and on left-mouse click over the panel, the panel turns red to indicate you can move the panel anywhere on the form, the panel becomes attached to the mouse pointer, then on another left click the object is let go. I have also created a class to allow for a context menu on each object created.
How are component in CAD apps created?
Basically my question is simple are the drawing of component in CAD apps, image or pictures or are they rendered line drawing at runtime.
My next trick of course is to some how replicate this, and I think its going to be the later. If I am correct about rendered line drawings does anybody have some sample code on creating simple shapes, like dots, circles, squares, rectangles and triangles? I think a library file would contain the coordinates of such shapes, for example a resistor symbol consists of two nodes, some lines and a zigzag.
|
|
|
|
|
I'm learning VB.Net and a problem I am trying to do asks the following:
Write a procedure that will print all prime numbers from 1 to N, where N is passed to the procedure as a parameter. A prime number is one that can be evenly divided only by 1 or itself. The smallest prime numbers are 1,2,3 and 5.
Write a program to test your function.
Hint: Identify the primes from smallest to the largest and store all the identified prime numbers in an array. Determine whether a new number is a prime number by checking the remainder of this number divided by each of the currently identified prime numbers, except for 1. If a new number cannot be evenly divided (i.e. no remainder) by any prime numbers that are less than the square root of the number, the new number is a prime number.
I'm lost!!! Can anyone help me?
Thanks
JB
|
|
|
|
|
!
Nice hint is that, it only makes it harder to understand...
Okay, maybe this will help you in the right direction:
Make a loop that goes from 2 (not 1!) to N.
Something like For i As Integer = 2 To N .
If i is a prime, store it in an array.
i is a prime if for each number stored in the array (lets call that p ), i / p is not a round number.
I have a code snippet if you want.
|
|
|
|
|
Ok, here's the function:
Public Shared Function GetPrimes(ByVal n As Integer) As Integer()
Dim primes As New ArrayList
'Print 1 at the start, don't add to primes!
Debug.WriteLine(1)
For i As Integer = 2 To n
'Calculate the square root of i
Dim root As Integer = CInt(Math.Sqrt(i))
'Is this number a prime?
Dim prime As Boolean = True
'Go to each previously calculated prime
For Each p As Integer In primes
'Check to see if the prime is smaller than the square root
If (p <= root) Then
'Check if rounded division and not-rounded division are the same
If (i / p) = (i \ p) Then
'Not a prime
prime = False
'No need to check any further
Exit For
End If
End If
Next p
If prime Then
Debug.WriteLine(i)
'Add the prime to the arraylist
primes.Add(i)
End If
Next i
'Insert 1 at the start of primes
'Can't do that at the beginning, because 100 / 1 = 100 \ 1
primes.Insert(0, 1)
'Return the primes
Return CType(primes.ToArray(GetType(Integer)), Integer())
End Function
Hope this helped you out!
|
|
|
|
|
Thanks dude, I'll look at it later today.
I might be hollering at you for further help if you don't mind....???
email me direct at jbaggett@hotfish.com for my Instant Message names
|
|
|
|
|
I want to make my project as a product.Then how can i convert my project into setup form in vb.net?
|
|
|
|
|
u check the vis 2003 and take setup and deplyment project then take
setup then put the exe
Continue...
|
|
|
|
|
i know that setup and deployment section but how to add our project to it and and configuration that i dont know
|
|
|
|
|
There's a wizard, and you select another project's output or something like that. Give it a try, you should be able to figure it out real quick.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I'm trying to put who ever updated the answer/comment boxes in a checklist into the correct history box. There are 39 answer, comment, and history boxes and i don't know how to get it to where when they update Answer01 or Comment01 to put the user into History01; Answer02 or Comment02 to History02....etc.... Help....PLEASE
|
|
|
|
|
Do you have a code sample or a screenshot? It might make it clearer of what you want to accomplish.
|
|
|
|
|
************Code******************
Public Function GetBoxName()
'This does ------
'Declare control variable
Dim ctl As Control, frm As Form
Dim name As String
'Set form equal to SQA Checklist. OTherwise if looking at active form an error
'will occur when debugging due to the debug window being active
Set frm = [Forms]![SQA Audit Checklist]
'Set control equal to the current box being edited
Set ctl = frm.ActiveControl
'Set current box name to "name" variable
name = ctl.name
Dim x As String
'Trim last 2 characters to use in SetHistory function
x = Right(name, 2)
End Function
Public Function SetHistory(x)
'This uses the 2 characters to set what name belongs w/ which history box
Dim user As String
user = CurrentUser
History = ("History" + x)
MsgBox (b)
End Function
Private Sub Answer01_AfterUpdate()
Call GetBoxName
Call SetHistory(x)
End Sub
*********Code End******************
I hope this makes sense. Thanks!
|
|
|
|
|
Help! I have been trying to solve these two problems that I have with my code.
1. Write code to select a drive letter highlighted in a listbox that can be added to a string. I can add to the string, but cannot make the command select the variable from the listbox.
2. Wait command with VB or Shell command. I have several programs that I need to run; One after another. The code I have will run these programs (.exe) files simultaneously and not wait until the first command is complete.
3. In addition, I do not know if this is possible, Norestart with shell command.
Here is some of my code...Please help.
Dim ProcId As Integer ' For Shell Comamnd
Dim drive_name As String ' For Drive Letter to be added to shell command
Private Sub Fx()
'drive_name = "" 'cboDrives.Name Needs help with code
If check1(0).Value = vbChecked Then 'Install DotNetFix
ProcId = Shell(drive_name & ":\\Update\\WindowsNeroUpdatefx.exe -q", vbNormalFocus)
End If
End Sub
Any help is greatly appreciated!
|
|
|
|
|
This should solve your first issue:
You cannot use .Name, this will return the Name property of your combo box. In your case, it will set drive_name = "cboDrives"
'drive_name = "" 'cboDrives.Name Needs help with code
Should be:
'get the current text displayed in the combo box<br />
drive_name = cboDrives.Text<br />
'OR<br />
drive_name = cboDrives.SelectedItem.ToString
|
|
|
|
|
Thanks! This is getting me closer to the final result!
cboDrives.text worked!
Thanks again.
|
|
|
|
|
Hi,
Can anyone tell me how to save flash files into database and retrieve them (plz send me the code if possible)
is there a way if yes plz tell me
thanks in advance
|
|
|
|
|
|
When closing a PrintPreviewDialog using the provided close button:
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in system.windows.forms.dll
Additional information: External component has thrown an exception.
Program is MDI, the form calling the PrintPreviewDialog is child form.
Any Ideas?
|
|
|
|