|
If your primary key is an integer, are you REALLY going to have 2.14 BILLION records in that table?
|
|
|
|
|
Even if that would be the case, you'd add another bigint-column under the key
I are troll
|
|
|
|
|
Yes, in theory you would be able to run up to a limit with a long-integer (32 Bit). You get 4'294'967'296 different values. If you create every second one record of data, you can do that for more than 2 years. I dont say, that it's not possible, but its seldom relevant in a real world application. You would probably run out of storage anyway.
If you are scared about this, use a database-engine, that allows for 64 Bit integers or GUID's as primary keys.
Regards: Didi
|
|
|
|
|
I'm issuing a Web Request and the stream i receive in response is empty but when i navigate to the same URL in my browser it's working fine and returning the data. Bellow is the basic code i am using right now.
Dim req As HttpWebRequest = HttpWebRequest.Create("http://192.168.15.40/touchscreens/get.qsp?display=1")
Dim res As HttpWebResponse = req.GetResponse
Dim sr As New StreamReader(res.GetResponseStream)
Dim dataReturned As String = sr.ReadToEnd
sr.Close()
MsgBox(dataReturned)
What could be the problem? Thanks for your help!
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
I have some logging code that I'd like to run for every sub and function, but I don't want to have to put a line of code in every single sub and function manually.
Is there an easy way to do this so the code runs for every sub/function called?
Also, I'm limited to using the 1.1 framework.
Example:
Public Class Class1
Public Sub LogSomeInfo(ByVal sMethodName As String)
'do something
End Sub
Public Function Test1() As String
'This is the call I'd like to run for every sub/function
LogSomeInfo(System.Reflection.MethodBase.GetCurrentMethod.Name)
'do something
End Function
Public Sub Test2()
'This is the call I'd like to run for every sub/function
LogSomeInfo(System.Reflection.MethodBase.GetCurrentMethod.Name)
'do something
End Sub
End Class
modified on Thursday, May 21, 2009 6:44 PM
|
|
|
|
|
Hi,
AFAIK there are two approaches:
1.
reduce the complexity of the line to a simple call, say LSI.log(); where LSI is some class with a single static log function that gets the stack traceback and locates its caller.
This still needs you to add one simple line, and the details of the work get centralized so you can easily change them later if that becomes necessary.
2.
code instrumentation: have the IL code modified before a method (or a class) gets executed for the first time. This is rather complex, too much so to explain here.
Personally I typically use an elaborated version of (1) where the LSI isn't global, instead it is a static instance of some class, that determines the classname once, and the methodname everytime. And my log() method also prefixes the current time (up to 1 msec) and the threadID (when different from the main thread).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I would prefer to use method #2 as it would be easier to maintain once implemented. However, if it is overly complex then I can make do with method #1.
Can you point me to an example using method #2?
Thanks for your help!
|
|
|
|
|
|
Much appreciated!
Thanks for all the help
|
|
|
|
|
--> i am using the following code in crystal reports XI's formula...
if isnull({vSTUDENT_FEE_DETAIL.Admission}) then
formula = "ooooo"
else
formula = "yyyyy"
end if
--> i am not getting the expecting result.
--> if the ADMISSION is NULL then it should print "ooooo" else "yyyyy".
--> when it is not NULL it displays the right result that is "yyyyy", but when it is NULL then it displays nothing..
--> ADMISSION is the field in the database table.
--> give me any clue.
--> thanks....
J A Nasir K
modified on Thursday, May 21, 2009 4:30 PM
|
|
|
|
|
Jamal Abdul Nasir wrote: --> give me any clue.
3.
|
|
|
|
|
42
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
--> wat do u mean by "3".?
J A Nasir K
|
|
|
|
|
|
Perhaps ADMISSION isn't null (with no value at all), but just an empty string. Alternatively, since that in itself wouldn't produce the result you received, you may be terminating program flow if ADMISSION is null before you ever actually get to the condition
|
|
|
|
|
--> actually Admission got values and null values as well. stil have a problem...
J A Nasir K
|
|
|
|
|
Try using: if vSTUDENT_FEE_DETAIL.Admission Is Nothing then
hth
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
--> this the code in the crystal report's formula. it does not support nothing in there.
J A Nasir K
|
|
|
|
|
Jamal Abdul Nasir wrote: this the code in the crystal report's formula
Would have been useful in the OP.
if you own the select change the select/proc to return a non null value
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Don't tell any one
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
I'll try to explain my problem using an example.
I have 2 classes (Class1 and Class2). I would like to insert pointers to instances of Class1 in an array that represents a property of class 2
This is the code:
Public Class Class1
Dim ciao As String = "Hello world"
Sub showciao()
MsgBox(ciao)
End Sub
End Class
Public Class class2
Public classi() As Class1
'HERE I DEFINE A METHOD TO CREATE A POINTER TO AN ISTANCE OF CLASS1 AND TO PUT IT IN AN ARRAY
Sub putclass2to1(ByVal index As Integer, ByRef classe1scelta As Class1)
classi(index) = classe1scelta
End Sub
End Class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim c1 As Class1 'declare one object of class1
Dim c2 As class2 'declare one object of class2
c2.putclass2to1(1, c1) 'call the method to put a pointer to c1 in a row of the vector of c2
c2.classi(1).showciao() ' call a metod of c1 using c2 in order to verify that the pointer works
End Sub
UNFORTUNATELY I get in correspondence of the privatesub this error "Object reference not set to an instance of an object."
Where Am I doing wrong? where is the mistake? Please help me!
Thank you in advance for your help.
End Class
|
|
|
|
|
nico2007 wrote: Dim c1 As Class1 'declare one object of class1
Dim c2 As class2 'declare one object of class2
You haven't created an object of these two classes. You just declared to variables that can HOLD an object of those types. You haven't actually created an instance of them yet.
|
|
|
|
|
I forgot to use the word New in my example but I used it in the code.
Dim c1 as new class1
dim c2 as new class2
or
dim c1= new class1
....
But I still get that error!
|
|
|
|
|
Copy and paste the ACTUAL code in use. Don't retype it or guess at it. You're going to miss something.
|
|
|
|
|
Your issue is that you never redim'd classi() as class1. so while in routine putclass2to1 you are trying to fill classi(index) when classi has been properly created...
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|