|
Adn this is the easy part! Google for "save image to database" and you'll find the technique documented thousands of time.
The rest of your requirements are university-grade research projects. You won't find much in the way of sample code to do those.
|
|
|
|
|
Hi to All,
sorry to say this is a cross post......But I have put here....coz may be there could be way in vb.net to do so...
I know my subject doesn't say much...All i need to know...is there any method so that the primary key of a table maintains its value after deletion of records.
Eg: if the table has primary key from 1-10. Now if I delete the row 1....primary key starts from 2-10....next time I insert a new record, it shoul generate the primary key as 1.
I am using VB.NET2005 with Ms acceess2007
Is there any function/way to do this....
Thanks in advance
-----------------------------
I am a beginner
|
|
|
|
|
himangshuS wrote: next time I insert a new record, it shoul generate the primary key as 1
You are making a fundamental error in database/data design. Your primary key should have absolutely NO relevance other than as a place holder. It must not matter to you what the number is. Primary keys must be stupid, they must not be used for any other job than holding your data structures together.
If a missing number ,the deleted record 1, causes you a problem then your design is screwed, you are screwed, your application is screwed. Do some reading on the use of primary keys.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
thnak you for your reply,
But, I believe primary keys are also having some value limitation(say if it is an integer, it is 4 byte at max)....So what happen when the number grows big in an real time APPLICATION. I guess it will give some irrelevant data.
Am I correct?. Please advice me
-----------------------------
I am a beginner
|
|
|
|
|
himangshuS wrote: Am I correct
Nope - the size of the primary key is irrelevant in the real world, MS at one stage recommended using GUIDs, Sybase used to randomly resets itself to a 6 digit key. In this case size doesn't matter, it's all about the quality of the data.
A primary key does not have to be an int - that's just the default.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
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
|
|
|
|