|
There's nothing that will do this for you. No special collection or anything like that. Your application design and coding must control the users ability to open only one form at a time.
When the user picks an option to create a new instance of a form (hopefully, this option will be DISABLED by your code when the user successfully opens a new form!!), you check a flag to see if a form is already open. If the flag is set don't create a new isntance of the form, otherwise, create the new instance and set this flag.
On closing the form, you clear that flag and enable the option to create a new form.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
ah this sounds goood...
will try it
thx
Regards
Ramy
|
|
|
|
|
Having a client who connects to servers automatically and insert data in a DB.
and in the same time.. having a user who works on these data,update and delete them...
i m afraid , that these 2 process run in the same time.
and worried about the data (insert and update in the same time)
note the Database is SQL Server Xpress Edition
Do you think Sql lockes the Tables while working on them ?
is there a way to lock the tables? for not using them with 2 process?
Regards
Ramy
|
|
|
|
|
Good question Actually SQL server waits for each connection session to to be done for database and then it updates the database with the change. However, when you deal with ADO to access a database to perform any action such as DELETE, UPDATE, etc., you should consider in opening the database with pesimistic or optimistic locking methods. I have given a sample below.
If Response.IsClientConnected = True Then
Set ObjectRecord = Server.CreateObject ("ADODB.Recordset")
ObjectRecord.CursorLocation = adUseServer
ObjectRecord.CursorType = adOpenkeyset
ObjectRecord.LockType = adLockOptimistic
ObjectRecord.Open GetTableName, ObjectConnection,,,adCmdTable
'adcmdtext for SQL Query
End If
I hope that helps
Journey
|
|
|
|
|
Hi
at the last hours ,, I founede that the VS.net program can't open any program ,, and the next message is appearing :
One or more projects in the solution could not be opend ....
Is there any method to solve that problem Or reinstall VS.net Package
jooooo
|
|
|
|
|
i think this is not your VS2005 problem.
The problem is in your project.
The project files may be corrupted or otherwise deleted or removed from that location.
try to create a new project and add that forms in the new project
Sathesh Pandian
|
|
|
|
|
Thanks my friend for reply
but the VS.net can't open or create any project
I try more then I uninstalled VS then reinstalled it ,,
now it's ok
jooooo
|
|
|
|
|
We are looking a freelance programmer for programming "Online Card Game" Application.
the picture -> http://members.lycos.co.uk/camarro/7pk1.jpg
Whoever has experienced and is interested to handle this project. please email me charles_salim@yahoo.com.sg.
|
|
|
|
|
my mail id is sathesh@anjusoft.com
or sathesh_pandian@hotmail.com
mail me your requirements
Sathesh Pandian
|
|
|
|
|
I am attempting to create a new Excel workbook and sheet. Which reference do I need to be using? The Microsoft Excel 11.0 Object Library seems to be working but it is really slow.
Cleako
|
|
|
|
|
I've used excel 9 lib both in VB6 and .Net 2003 performance was good
|
|
|
|
|
I am working on an application in which I have to play programs from server to different different ports on user demand I am getting the IP address and port no now I want to use window media player to play the Program on users monitor but window media player want file name or url to run the program. but the programs are live which running on server. My Idea is that ,try to store the program in temp file and then run it on users monitor. Any suggesion or better option to implement this??
namita
|
|
|
|
|
Do you know what a URL is?? You give it the URL of the stream you're trying to play which would include the port number:
mms:
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I want to play mp4 format movie through vb.net. so can any one help me how to connect window media player in dot net.
namita
|
|
|
|
|
Right-click the Toolbox and click on Add/Remove Items... In the dialog that comes up, click on the COM tab and find the Windows Media Player. Double click that to add it to the toolbox. You can then just drag and dorp an instance of it to your form.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I am trying to pass an arrylist to a child form as below. I get an error saying not posible to cast Stockobj to Stockobj.
If I change the arraylist to contain strings not objs it works fine.
Any clues welcome
Thanks
Parent Form
Public Class Stockobj<br />
Public Id As Integer<br />
Public Name As String<br />
Public Plex As String<br />
End Class<br />
<br />
Private WithEvents MixForm As MixForm<br />
<br />
Dim StockNameList As New ArrayList<br />
<br />
'Code Populates StockNameList<br />
<br />
Me.MixForm = New MixForm(StockNameList)<br />
Me.MixForm.Show()
Child Form
Public Class Stockobj<br />
Public Id As Integer<br />
Public Name As String<br />
Public Plex As String<br />
End Class<br />
<br />
Dim StockNameList As New ArrayList<br />
<br />
Public Sub New(ByVal StockAliquots As ArrayList)<br />
InitializeComponent()<br />
End Sub
|
|
|
|
|
You can't have two classes with the same name in the same assembly. You're defining Stockobj twice...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave I have renamed both destination obj and arraylist i still get the following error
Unable to cast object of type StockObj to NewStockObj. Excepy for the name they are indentical.
Cheers
|
|
|
|
|
They aren't identical because they are completly different objects Having the same properties and methods doesn't make two objects the same. What you need to do is define StockObj once publicly so that both forms know about it.
|
|
|
|
|
Ok Thanks, Makes sense wil give it a whirl.
|
|
|
|
|
got 1 form with dateandtimepicker on it but trying to send that info to another dtp on another form but the message reads that you cannot convert string to dateandtimepicker.
thank you before hand.
|
|
|
|
|
What's the code you're using to get the value of your first DTP and send it to the next form?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
this code is for the add button on my performance form that will send the details to the reservation form but it says that value of string cannot be converted to 'system windows form.TextBox
frmNewBooking.txtDateOfPerformance = dtpPerformDate.Text
|
|
|
|
|
the code you want is
frmNewBooking.txtDateOfPerformance.TEXT = dtpPerformDate.Text
you're reading the text out of the DateTimePicker and then you need to assign it to the Text Property of the Textbox. Textboxes are more than just text - they have other properties available
Jason
|
|
|
|
|
yes i dont know what i was thinking had text on the others but missed on the date and time picker cheers.
|
|
|
|