|
You're doing a bad job of describing your homework. I hope you do a better job of doing it, or you will fail. We offer advice to people stuck with specific tasks, we don't do people's projects for them.
It's not even clear what sort of app you want to write. Of course it's possible with VB.NET.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
|
My question is based on database record locking .
Like , can i lock the record after clicking the edit button.
This requirement occured due to the reason when more then one user to trying to modify the same record.
|
|
|
|
|
You can store in the database that a record is locked, using your own table design. There's nothing built in AFAIK.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
That means , if I am having 10 client users , then I need to keep track on all the user names , and to note down , which one has opened the record for editing purpose ??? Is there any other way out?
I think it will become very complicated.
|
|
|
|
|
I was part of a project that ran for four years, which involved multiple users accessing documents in a database. In that time, no-one on that team was able to suggest any way of automatically locking records on a database, we didn't bother doing it ourselves, but we discussed the problem from time to time.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
|
It seems standard practice is to include Modified field in your tables that holds last timestamp of the last modification of that record. When you go to get data from the database, you also make sure you grab the Modified field for your records. During the UPDATE, your SQL statement must match the recordID AND Modified time that you fetched. If the modified time doesn't match, the record has been modified by someone else while you were looking. The update will, of course, fail. This will mean that there is a concurrency violation and you'll have to handle this condition as you see fit.
|
|
|
|
|
Optimistic locking[^] would ensure that users cannot overwrite changes made by other users.
SQL-Server supports "Pessimistic locking" by allowing you to specify a "holdlock" hint on the select statement - within a transaction that spans the user's edit session. Only one person can hold the record-level lock at a time. However this approach can hurt database performance because (unless you use the fancy new snapshot isolation levels under SQL-Server 2005) any users selecting on the table will be blocked.
|
|
|
|
|
How do you plan to save the data back to the database?
If you are using ADO.NET, maybe you should let the users know if the save operation failed catching the DBConcurrencyException when you try to save with the dataadapter.update. If a record cant be updated because it was modified since it was last read by that user, then, just let the user know about it and give it the chance to refresh the record, show both version, or whatever you think is more convenient
Alexei Rodriguez
|
|
|
|
|
My problem is based on Registry.
Like in HKEY_LOCAL_MACHINE
there are following items........
1.HARDWARE
2.SAMS
3.SECURITY
4.SOFTWARE
5.SYSTEM
can i programatically find out - using loops or any another way - to list these items , that comes under HKEY_LOCAL_MACHINE.I mean
if i write
dim len() as string = findsubkeys(HKEY_LOCAL_MACHINE)
i am just trying to make my problem clear y using a unrealistic function findsubkeys.
Thank You.
|
|
|
|
|
Have you looked at the GetSubKeyNames method of the RegistryKey class?
Dim HKLM As RegistryKey = Registry.LocalMachine
Dim subKeyNames As String() = HKLM.GetSubKeyNames()
|
|
|
|
|
Hi,
Could some budy give idea or a small program would be better on, how to use LTrim & RTrim Methods. What I want is if i enter anything in textbox with blank spaces between them from left and & right & if I click button those spaces should be removed.
Nitin Jenwal
|
|
|
|
|
Try this code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim str1 As String
str1 = (RTrim((LTrim(TextBox1.Text))))
MsgBox(str1 & "," & Len(str1))
End Sub
With Regards...
Sanjay K
|
|
|
|
|
hello Nitin,
actually the LTrim and RTrim are the mehtods used to remove the blank spaces from Left and Right side respectively,
text1.text = "****Hello****" 'Take * as Blank Space
text2.text = Ltrim(text1.text)
the Text2.text contains = "Hello****"
and same for Rtrim and if U use only Trim then bothside blank sapces are removed.
regards,
koolprasad2003
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Great Help,
one more thing what i want is to write a code that deletes spaces from both L & R sides, & I want to show it in a same textbox, I don want to show it in new one.
Could you help me
Nitin Jenwal
|
|
|
|
|
The trim method, on the string class, will remove whitespace from both sides.
textbox1.text = textbox1.text.trim() will do it
buy a book.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
I am trying to create an autorun executable that runs when the end user puts the cd in the drive. I would like it to have menus and buttons to open files that are on the disk, but have it check that the user has the programs to open the files.
PS I am using Visual Basic 2005 Express Edition
Any suggestions will be most appreciated
Tim
|
|
|
|
|
Your auto run program needs to be written in C++, unless you can guarentee that the .NET framework will be preinstalled on all PCs that have your CD put into them.
TO make it work, you just create an autorun.inf file on the root of your CD
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Looks like I'll have to get glued up with C++ then.
Chears
|
|
|
|
|
i am using dotnet 2003.i am doing my project in vb.net windows application.i have two form in my project.first form is datagrid .In second form label,textboxes and combobox are avilable to save the entering values in datagrid of first form through this 2nd form.my problem is,i want to search a value using combobox.
for example,
in first form,
there are 4 columns named as name,age,rollno,address in datagrid.
values are ramu for namecolumn,24 for age column,42 for rollno column,cbe for address column.now values in datagrid like below
id name age rollno address
1 ramu 24 42 cbe
2 somu 23 32 che
here id is primary key.
in 2nd form,there are 4 label,4 textbox and 1 combobox.textbox arenamed as nametextbox,agetextbox,rollnotextbox,addresstextbox and 1 combobox named as searchcombobox.
now values of name(ramu,somu) are stored in combobox.
my problem is,
in second form,
if i click the value ramu in combobox means,want to display the values of ramu in textboxes.(ie..want to display automatically ramu in nametextbox,24 in age textbox,42 in rollnotextbox,cbe in address textbox)
during runtime in vb.net windows application.so how i automatically display the values of row in each textbox by clicking the values in combobox.plz help me.
|
|
|
|
|
First of all tell me from where you are filling the From2 combobox items???
With Regards...
Sanjay K
|
|
|
|
|
hi,
use following code at selectedIndexChanged event of combo
dim i as integer
for i=0 to form1.datagridview1.rows.count-1
if form1.datagridview1.rows(i).cells(1).value.tostring=me.combo1.text then
me.textbox1.text=form1.datagridview1.rows(i).cells(1).value
me.textbox2.text=form1.datagridview1.rows(i).cells(2).value
me.textbox3.text=form1.datagridview1.rows(i).cells(3).value
me.textbox4.text=form1.datagridview1.rows(i).cells(4).value
exit for
endif
next
Hope this Helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
I suggest you take a look at databindings to make all the assignation part a lot more easier and automatic
Also, in the combobox, you should set its datasource, to the same datasource you are using for the textboxes so it will change the row automatically when when the combobox selectedindexchanged event is raised
Alexei Rodriguez
|
|
|
|
|
Hi,
What is the concept of NameSpaces in VB.Net
Nitin Jenwal
|
|
|
|