|
Well, if a simple count as Mycroft suggests isn't good enough you are going to have a problem - different processors, memory etc etc. You could time the 1st iteration and use that combined with the number of records to give a rough approximation I expect.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Thanks to all who replied my question n thier suggestions
The Great Pleasure In Doing That Things That Other People Say U Can't By Doing This U Can Shut Their Mouth
|
|
|
|
|
Hello every one..
I will re-describe my objective...
I have a application working over a network and having a centralized DB server..
For new registration we were generating a ID by combining YYYYMM(a number sequence). The sequence is stored in a table.
Now we have to modify the application so that the registration can be done at more then one place.
I read the Number and add 1 to it, insert the registration info in register table and then update the number.
Now my issue is when we will start doing registration at two places there are chances that both the system will access the same number and there can be c conflict...
I just knew that this type of things are possible by table locking some kept table locking in the subject..
Can any one plz help me out with what exactly i need to do and may be how also..
Regards
Nishkarsh
modified on Tuesday, May 27, 2008 2:56 AM
|
|
|
|
|
And you will still get the same answer: Transaction. Transaction is basically a "managed" row locking so why "unmanagedly" locking the whole table and potentially causing nobody to be able to use the table?
Also throw aways the table locking idea that exist in the file-database era (Access etc).
|
|
|
|
|
darkelv wrote: Transaction
I have to say, there's no better way, it's what they were made for - controlling update sequences amongst other things.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Listen to darklev - use a transaction in your stored procs to insert to the various table.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi guys
I am getting a soap exception in creation of a site in wss:
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Testx.AdminSer.Admin.CreateSite(String Url, String Title, String Description, Int32 Lcid, String WebTemplate, String OwnerLogin, String OwnerName, String OwnerEmail, String PortalUrl, String PortalName) in C:\Documents and Settings\mohannad.gh\Desktop\Testx\Testx\Web References\AdminSer\Reference.vb:line 95
at Testx.Form1.CreateSite_Click(Object sender, EventArgs e) in C:\Documents and Settings\mohannad.gh\Desktop\Testx\Testx\Form1.vb:line 1342
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at Testx.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
this is the following code.
Dim siteURL As String = "http://servername:4000/sitename"
Dim siteTitle As String = "TestSite"
Dim sitedes As String = "Site for testing"
Dim lcid As Integer = 1033
Dim SiteTemp As String = "STS#2"
Dim adminService As New AdminSer.Admin()
adminService.Credentials = New Net.NetworkCredential("admin", "pass", "workgroup")
adminService.CreateSite(siteURL, siteTitle, sitedes, lcid, SiteTemp, "workgroup\admin", "adminName", "", "", "")
Not sure what is happening, any inner exception is nothing.
Any pointer is appreciated.
Thanks
|
|
|
|
|
Does anyone know how I can loop through a collection and start a thread to process each item in the collection, but I want to limit the number of threads running at a time to the number of cores on a PC.
Regards
|
|
|
|
|
im_hoser wrote: but I want to limit the number of threads running at a time to the number of cores on a PC.
I've always found this to be pointless. How many threads are already running system-wide before your app even starts?? 10? 50? Try over 200. So, whats another thread going to matter? Why limit your threads to 2 or 4?
|
|
|
|
|
I share your view Dave, unfortunately I cannot override my management. With that said have you come across this problem? How did you solve it?
Regards
|
|
|
|
|
im_hoser wrote: have you come across this problem? How did you solve it?
Only in a thought experiment. But, you can get the processor count from
Environment.ProcessorCount . You can then create your own threads and set their ThreadAffinity to get them to try and run on a particular processor if you want.
|
|
|
|
|
I found where to get the processor count. The trouble I'm having is creating a loop to process items in a collection from a thread and limiting the number of started threads to the number of cpu's. Lets say I have a thousand items in a collection and a dual core processor. I only want to start 2 threads at a time to process the thousand items until completed .
Regards
|
|
|
|
|
Hi guys
I am getting a soap exception in creation of a site in wss , this is
the following code.
Dim siteURL As String = "http://servername:4000/sitename"
Dim siteTitle As String = "TestSite"
Dim sitedes As String = "Site for testing"
Dim lcid As Integer = 1033
Dim SiteTemp As String = "STS#2"
Dim adminService As New AdminSer.Admin()
adminService.Credentials = New Net.NetworkCredential("admin", "pass", "workgroup")
adminService.CreateSite(siteURL, siteTitle, sitedes, lcid, SiteTemp, "workgroup\admin", "adminName", "", "", "")
Not sure what is happening, any inner exception is nothing.
Any pointer is appreciated.
Thanks
|
|
|
|
|
...and the Exception would be ____??????
|
|
|
|
|
I want to download data from an URL, i've tried all methods but can't find how to use this URLOpenStream Function...
Can anybody help me...
Tnx
|
|
|
|
|
|
I have a 32bit application built on vb.net2003 that uses the bundled crystal reports.
It installs and runs flawlessly on XP platforms.
when I install it on Vista Business (x64), the app runs fine, but any attempt to generate a report (that is, to instantiate a derived report class, as in, "dim rpt as new rptWhataver") results in
Cannot find KeycodeV2.dll, or invalid keycode.
keycodev2.dll is in fact present, and the app was built properly with the keycode property.
again, this app, and the reports work fine in about 1000 locations around the world on XP, win2k, and (gasp!) win98se. Anybody have a suggestion or work-around?
rani
|
|
|
|
|
I think I already answered this.
|
|
|
|
|
Do NOT repost the same question over and over. You just posted this 5 hours before. Show some patience. You're not paying for support here, and we all volunteer our time to answer questions. But, we answer them on OUR schedule, whenever we can spare the time, not on YOUR schedule.
|
|
|
|
|
Dup question...it's a habit of his.
|
|
|
|
|
Hello every one
Can some one plz help me with example of table locking. Wat i want to achieve is to lock the table for the time user one is doing read immediately followed by a update. If user 2 access the table he should be able to do so after the user1's operation is over
I am using datareader to read data.
Regards
Nishkarsh
|
|
|
|
|
Table locking is not what you are looking for. What you should use is a transaction.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Table locking is only for very specialized circumstances. Locking antire tables severely limits your app's scalability and increased administraive overhead. Think about it. If you app locks a table, then crashes, what do you do?? The lock doesn't clear itself...
|
|
|
|
|
Good Afternoon All
Am Overriding the Paint Method. i need to Change Colour based on the Value of a Certain Column. The Following Code Will Look for that Value in Every Column and Change the Colour in those Cells.
Dim o As Object<br />
o = Me.GetColumnValueAtRow(source, rowNum)<br />
If (Not (o) Is Nothing) Then<br />
Dim c As Char<br />
c = CType(o, String) '.Substring(0, 1)<br />
If (c = "True") Then<br />
' could be as simple as<br />
' backBrush = new SolidBrush(Color.Pink);<br />
' or something fnacier...<br />
backBrush = New LinearGradientBrush(bounds, Color.FromArgb(255, 200, 200), Color.FromArgb(128, 20, 20), LinearGradientMode.BackwardDiagonal)<br />
foreBrush = New SolidBrush(Color.White)<br />
End If<br />
End If
How can i change the Change the Entire row based on a Value in a Certain Column
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Since you are talking about columns and rows, are you using a DataGridView? If so, you want to look at handling the CellFormatting (http://msdn.microsoft.com/en-us/library/z1cc356h.aspx[^]) event. A DataGrid also has a similar event, try looking at this article[^] for more details.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|