|
Your rows need a 'locked by' column, which takes a user id. If it's not null, or a 'magic number', then it's locked. You probably also want to store the date/time it was locked, because you probably want the locks to automatically time out, otherwise, your system will fail if a user doesn't perform the action that unlocks it again.
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 )
|
|
|
|
|
Thank you, we have the same thing in mind but can you provide code for my problem?
Dabsukol
|
|
|
|
|
If it's not self evident, you probably shouldn't be doing it. It's a bunch of code, to do something that's really trivial. Your users have an Id, you have a column which contains, say, 0, or the Id of the user ( assuming they start at 1 ) who has it locked. You store the time it's locked as well. When someone tries to lock a file, first check the date/time of the last lock, if there isn't a lock, or if it has expired, lock it, otherwise return a code which tells your UI to show an 'in use' message.
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 have a 3-Tier application. In the DAL I decribe my table containing some fields that are to be the ID of another table in my database. When I create my select statement it returns the fields as ints. I also created another select statement that returns strings for those fields(by inner join with their related table). The first select statement works, the second does not, since I am returning strings for a field that is expecting ints. How do I override this or how do I fix this problem.
The error I get is very generic:
Input string was not in a correct format.
I can post more of the error but it basically says it can't convert the string I am returning into the int it is expecting.
Thanks for any help.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I don't follow - if an int is expected, why are you not returning one ? Why are you returning strings instead of ints ?
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 filling dropdownlists. I have other tables in the database that contain the ID to be stored in the database, and the user friendly string. I am using inner join to do this. How do I fill dropdownlists in a 3-tier app based on the information in the table that has the ID.
Example:
My database contains the following tables:
Person:
Name (String)
Group (Int)
Static Groups:
ID (Int)
Group Name (String)
Data in the Person table might be:
Chris
1
Data in the Static Groups table might be:
1
Administrator
2
Power User
I am using DAL, BLL and presentation layers, and ObjectDataSources to connect to the BLL from the presentation layer.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
my datagrid has 30 records but requirement is only one record is displaying at a time and also i have next button.in output by default first record is displaying then after clicks on next button again first record is displaying after that 2nd,3rd,4th.................upto 30th is displaying ,my problem is why datagrid is displaying first record two times .
srinivas
|
|
|
|
|
It is because on your postback your datagrid will always be one step behind. I have had the same problem many times, the fix for it is to find what event you need to fire after and it changes for different situations, usually OnPreRender works.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
hi expert coming iam giving like this but in datagrid it is displaying even records please help me yaar please
is it correct or not
protected override void OnPreRender(EventArgs e)
{
dg1.CurrentPageIndex+=1;
base.OnPreRender(e);
}
private void PreRender_Handler(object sender,System.EventArgs e)
{
dg1.CurrentPageIndex = Convert.ToInt32("");
}
srinivas
|
|
|
|
|
Your trying to show every other record? Explain what you are doing, because it sounds like you are doing something different from what I original took it for.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
How can we enumerate and print through Network Printers?
Any link or code.
Help appreciated both ion VB.Net or C#.
Thank You!
X
|
|
|
|
|
Hi All,
Any1 of you know how to print a rdlc directly without going through report viewer in window application?
I have spent almost a week but still could not sort it out. Hope you guys can help me on this.
Thanking you in advance.
|
|
|
|
|
Hello everyone,
I am working on a Windows Application which deals with lots of data transformation between the user and a remote database. In order to keep the user informed with all the Data going back and forth between the user and the remore database, I would like to have a Child Window pop-up showing the progress.
I was wondering if anyone can point me into a right direction or a tutorial so I can get this done.
Thank you very much and have a great weekend.
Khoramdin
|
|
|
|
|
If you're doing a single action, you can't show meaningful progress, and if you're making lots of DB calls, turning them into a single call will make it much quicker.
You need to perform your action in another thread, so the UI does not die, then you can show a scrolling progress bar in your main thread.
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 )
|
|
|
|
|
Gents,
I'm experimenting with indexing and I came across the following problem that I cannot fully grasp.
I have a combobox filled with stuff ( the collection items ). I want to remove it all at once so that the collection is empty again. So after some thinking I though I try the follwing :
private void ClearComboBoxes()<br />
{<br />
for (int x = 0; x < cmbtrackWhere.Items.Count; x++) <br />
{ <br />
cmbtrackWhere.Items.RemoveAt[x]; <br />
}<br />
}
It gives me the error : " Cannot apply indexing [] to an expression of type 'method group'
I assign the value zero to the integer x , count the items in the collection and add 1 to x if necessary until x is equal to the number of items in the collection. Then I remove each item on index [x] from the collection.
Am I thinking in the right direction ? .. can anyone briefly explain to me what I'm doing wrong and why it fails ?
kind regards,
|
|
|
|
|
If you want to remove all of the items in a combobox, you should use:
<br />
cmbtrackWhere.Items.Clear();<br />
This will remove them all at once.
If you are trying to remove an item at a specific index, i think your code should be something along the lines of:
<br />
cmbtrackWhere.Items.RemoveAt(x);<br />
|
|
|
|
|
So the mistake was to use square brackects; RemoveAt is a method, it needs parentheses.
Furthermore, as soon as you remove an item, all the higher-numbered items get moved
down one positition, so if you need to remove al but the first N items the correct
code would be:
for (int x = N; x < cmbtrackWhere.Items.Count; x++) {
cmbtrackWhere.Items.RemoveAt(N);
}
This loop continues to remove the first unwanted item, until there are no more unwanted
items left.
There is of course the alternative to remove them in reverse order:
for (int x = cmbtrackWhere.Items.Count-1; x>=N; x--) {
cmbtrackWhere.Items.RemoveAt(x);
}
Of course, if you want to remove everything there is the Clear() method to do that.
|
|
|
|
|
Hi guys,
I need some help. I have a crystal report that I am trying to point to and print. I have to pass datasource name, database name, pwd, etc also I need to pass one parameter. Can anybody help me with this, I get the password failed error and before that it opens a dialog box asking me to save an image. Weirdddd
Please help
sasa
|
|
|
|
|
Hey all. Is there anybody that’s interested in helping me with some mono/linux/C/C# dev.
I'm trying to get mono/C# integrated with a open source project www.freeswitch.org
I'm need the help from somebody that’s familiar with C/C# and marshalling.
If this has anybody’s interested please let me know.
Martin
|
|
|
|
|
Hello
I use application's configuration settings to store user's preferences. when I launch the program manually it works well and saves and retrieves all the settings but if I add the program to windows startup then when the program is launched settings are not retrieved and aren't saved either. Why does it happen?
|
|
|
|
|
how to open a MS word file through a label link in the application
|
|
|
|
|
Either use process class to open the needed file or if you need more control over the document then use word object model
|
|
|
|
|
i couldn't do what u told me
plz can anyone help
|
|
|
|
|
Which method did you try?
|
|
|
|
|
Dear all,
i am doing some analysis on RC4 TKIP.I want to create an RC4 key and XOR it with data.My RC4 key is Ok.But i want to pass it as a parameter so as to do encryption.
Can anyone among you help
Thanks
NB
|
|
|
|