|
Hi Guys, first of all Thanks for offering help. I found out what was causing the error (still do not understand why). The three top variables are being loaded by running queries and each function is supposed to return TRUE/FALSE (they do). I understood that Local Variables (within subs or functions) were automatically disposed off, once the focus leaves the sub or function. But my Local Recordsets are not being disposed off, and for some reason that goes beyond my little knowledge is preventing me from starting a Transaction.
this is weird. Because I am not hardcoding the dispossal of any of my local variables at all, and this is the only piece of code that generates this error.
Once again. Thank you guys for offering your help. HAVE A VERY HAPPY NEW YEAR
Alex. (STILL A VERY LOST NEW GUY)
|
|
|
|
|
alexvw wrote: Recordsets
ADO.NET does not have recordsets. Classic ADO does. You should be using ADO.NET. This may be an incompatibility issue.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
As Colin said, you should be using ADO.NET, not classic ADO. The reason your recordsets are not being disposed is that they are not managed objects, but wrappers around COM objects (whose lifetime you must manage yourself). ADO.NET is supported by the System.Data.Oledb namespace in .NET.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
What do u mean by recordset here. Is it traditional recordset of ADO or u r talking abt DataReader of ADO.Net.
Plz give the details of "Data" or atleast "Data.Get_TAccount"
Akif
|
|
|
|
|
how can i use database(access) in pascal .if it is impossible please give me another solusion.i search the web but did not get any advantage
|
|
|
|
|
aspnet_22 wrote: how can i use database(access) in pascal
PASCAL? Do you mean Delphi or TurboPASCAL? In tp it is imho impossible. With Delphi Prof you can use Access-DBs with die ADO-components.
'A programmer is just a tool which converts caffeine into code'
|
|
|
|
|
if do you mean we can use delfi utilities in tp7?if possible give me some samples?
|
|
|
|
|
aspnet_22 wrote: do you mean we can use delfi utilities in tp7
No, you can't do this. If you want to use PASCAL buy Delphi 2006 or if you prefer PASCAL for .NET u should buy VS2005 >= standard (standard, prof, team suite) and Chrome 1.5[^].
André
[edit] correct spelling [/edit]
'A programmer is just a tool which converts caffeine into code'
|
|
|
|
|
VickyC# wrote: Does anyone knows if there is a tool in the market that could optimize an SQl Query. I am looking for something that would do a mathematical way of optimization.
Isn't that what the query optimiser in SQL Server already does?
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|
|
|
VickyC# wrote: looking for a mathematical/relational optimization tool
Could you elaborate on what you need? Mr. Mackay's advise is probably the best. Only other optimization tool that could work, according to Michael Abrash's Zen of Code Optimization, is right between your ears
Paul
|
|
|
|
|
VickyC# wrote: I guess if this does not say it all then I am asking the wrong people.
Might not be a matter of asking the wrong people. Maybe there isn't an answer. Don't vote people down who are trying to help
|
|
|
|
|
No problem about opinion, which we all are entitled to as humans. However, be careful about trying to teach someone about professionalism when you wrote:
I am looking for a mathematical/relational optimization tool.
I guess if this does not say it all then I am asking the wrong people.
But since I've googled and Dave googled and no results came up that sounds like what you are looking for, then maybe you could come up with a tool that suits your requirements and share with your fellow IT professionals (whether it be by FEE or FREE).
Happy coding
Paul
|
|
|
|
|
After Googling for this for about 30 minutes, what you want doesn't exist.
All I found were tools that do the same thing that the Analyzer does in 2005.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave,
I found the same thing too. Google is often a great place to find things, if it can't be googled, then it may not exist. I often see google like the "Jedi Archives" from Star Wars where the jedi librarian tells Obi-Wan Kenobi that if it isn't in the archives, it probably doesn't exist. 5 points for your post
Paul
|
|
|
|
|
I have a table with two columns named IdHorse and IdRider.
How can i prevent the table of having more then one horse with the same IdHorse. Can i do that in the INSERT INTO statement ore alter the table somehow
|
|
|
|
|
The detail you supply is a little vague. Here is my understanding and assumptions:
There is a table with two columns
IdHorse
IdRider
[Assumption] There is only to be one IdHorse in the table. It identifies the horse, therefore it is the primary key.
Solution: Make IdHorse the primary key. It will enforce uniqueness.
However, from the way you described it, I have a feeling there is some missing information somewhere which would invalidate my assumption and therefore the solution.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|
|
Hello,
I am having a problem with specifying DSN in the SqlConnection object's connection string. How can I specify DSN for SqlConnection string. (Can I specify it at all?)
Thanks in advance.
Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
simply type
imports system.data.sqlclient<br />
<br />
dim conn as sqlconnection=new sqlconnection("data source=<servername>; initial catalog=master; uid=sa; password=;")
abhinav
|
|
|
|
|
How can I generate reports using SQL Server Reporting Services (Programatically)
|
|
|
|
|
hi
which is better views or procedure where i have store the data and autogenrate a number and store its value in the database + doing some calculation for a paricular column in the web page code behind and storing the data in the same table.
thanks
sasi
|
|
|
|
|
Personally, I prefer to access all data through stored procedures as this adds some extra protection in my application as I can revoke the access to the tables which means that if anyone gains access they can only do what the stored procedures petmit them, rather than have unfettered access to the tables directly.
Views kind of come in the same category as they allow the actual tables to be hidden behind the façade of the view.
There are not really any advantages or disadvatages either way. It depends on how you prefer to work. If the calculation is simple enough then a view will be fine.
However, if you require to filter the rows at any point then a stored procedure may be better as you can filter early and this sometimes helps the query optimiser find a better plan.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|
|
Can someone help me with this one i have writen a function that retrieves a Id from a table but the result is not found and i get the above error.
Public Function getID(ByVal strTable As String, ByVal strValue As String) As String
Try
Dim IDConn As SqlConnection = New SqlConnection("server=localhost;uid=sa;pwd=;database=EventMngt")
Dim IDString As String = "SELECT Id FROM Boekelo_Horses WHERE Horse_Passport = '" & strValue & "'"
If strTable = "Boekelo_Riders" Then
IDString = "SELECT * FROM Boekelo_Riders WHERE Rider_FEIId = '" & strValue & "'"
End If
Dim IdCommand As New SqlCommand(IDString, IDConn)
IDConn.Open()
Dim IDReader As SqlDataReader = IdCommand.ExecuteReader()
IDReader.Read()
getID = IDReader.GetString(0)
IDConn.Close()
Catch ex As Exception
MessageLabel.Text = strValue & " is not on the DataFile, try again.<br>Error text:" & ex.Message
getID = "-error-"
End Try
End Function
If i comment out the getID = IDRea... line then the function returns no error, if in the function it produces a error. But why??
|
|
|
|
|
gharry wrote: i have writen a function that retrieves a Id from a table but the result is not found and i get the above error
If there is no result then what can it cast to a string?
You need to check if the result is null first, then get the value (if it exists).
Use:
IDReader.IsDBNull(0) to determine if the value is null before trying to get an actual string value.
See Also: SqlDataReader.IsDBNull()[^]
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|
|
I replaced some code to check on it but no result.
Dim IDReader As SqlDataReader = IdCommand.ExecuteReader()
IDReader.Read()
If Not IDReader.IsDBNull(0) Then
getID = IDReader.GetString(0)
Else
MessageLabel.Text = strValue & " is not on the DataFile."
getID = "-nodata-"
End If
|
|
|
|