
penfold69
Avatar/Signature-
Posts
135 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by penfold69
-
use: response.write "<img src='file.asp?ID=" & ID & "/>"
-
CR 10 - Serious Strange Issue...
penfold69 replied to EFileTahi-A's topic in Database / XML / Reporting
Have you unchecked 'Save Data With Report' ? B -
Google for: "Progress 4GL" in quotes - you should find some info about it. And yes - its a completely custom programming language, and the IDE etc for it costs thousands. So, getting experience in it is bloody hard! B
-
Be my guest and test away. I'm basing my statements on prior knowledge, and also the internals of the MySql.Data library, which is a fully managed, open source library for accessing MySQL Databases. The beauty of open source is the ease at which you can inspect the source and see exactly what it does in these cases, and in this case, I know I'm correct ;) B.
-
No. SQL Server is an application that only runs on MS operating systems. The SQL Namespaces (and other Database namespaces) available on Mono merely 'talk' to an available SQL server. They do not provide any SQL server functionality themselves. Similarly, the OLE/ODBC namespaces only communicate with various libraries that handle the 'actual' database work. Access 'databases' are usually handled by the MDAC which acts as a quasi-server for these type of database. I'm unsure as to whether Mono supports .MDB databases, but if they do, then someone has most likely actually written the database-access support into the relevant namespace. We actually run a RHEL3 server here in the office with Mono installed. I compile various programs/DLL files on my Windows development machine and install them onto the Linux box. They then periodically run via CRON and do various things like generate reports. The *exact same* exe/DLL file will run on a Windows box without modification. The programs themselves actually connect to a MySQL database using the MySql.Data namespace. I don't particularly care *how* it achieves it, I merely know that it does, and works on both platforms without recompilation. This is the beauty of the .NET IL - because mono is (almost) 100% compatible, programs compiled on Windows will need no modifications (and in 99.5% of cases no recompilation) to work under Mono on any supported operating system. B.
-
And in addition, the MySql.Data.MySqlClient also supports connection pooling, and follows the IDBConnector/IDBCommand interfaces, so is 100% compatible with the SqlClient libraries Although I do acknowledge what HJB417 says - it *IS* provider dependant, but any drivers that ship *as part* of the framework *do* support pooling by default. B.
-
One of the most important functions that parameterisation handles is the proper escaping of control characters within parameters. Take the example of a text string containing a single quote. Without parameterisation, an SQL statement could end up syntactically incorrect, due to the inclusion of a single quote charater, or even worse an SQL injection attack could be present. Using parameters would escape the single quote character (with a leading \ in the case of SQL server, I believe) so that it is interpreted an a literal string within the statement. Without parameters: Select * from MyTable where MyField = 'Bob's House' With parameters: Select * from MyTable where MyField = 'Bob\'s House' This *is* handled by the SQLClient, so that any strings sent to the server are 'sane' in terms of input. B.
-
Not being an ASP user, but can't you compile it to a DLL and reference it from within the c# project as that? P
-
If you're dealing with your own user-drawn controls, ensure that all your GDI objects are being disposed explicitly. I've certainly had the case where I forgot to do so, and every 'action' with my user control WITHIN THE DESIGNER caused massive memory usage in a very short space of time. I'm working on a multi-project soplution at the moment, with around 18 DLL files and three executables totalling around a million lines, and my copy of Visual Studio (2003) usually runs between 200-300MB memory usage at any given point in time. (on a machine with 1.5GB, its pretty nippy ;)) B
-
Just as an aside - I'm pretty sure that when an application is minimised, Windows forces a GC on the application (be it a .NET app or ANY other app) because it is assumed that the application is being put into a 'semi-hibernative' state No idea why I think this, and I can't back it up with any concrete information, I'm just sure I read it somewhere in the MSDN docs. This would explain why restoring/minimising the (only) form in your application reduces memory usage - its effectively triggering this global GC. I'll see if I can't dig up some facts on it, not just hearsay. B.
-
Isn't that something that should be handled in the destructor of the collection? Surely the destructor will get called if the object is destroyed, even at design time? Without testing, I'd assume that: Private Sub Finalize() For index as Integer = 0 to list.Count - 1 list.Item(index).Dispose() Next Obviously, your item has to implement IDisposable, or some other GC method. B.
-
In your overridden Collection class, don't you simply return the object of the correct type? Something like: Public Class MyCollection Inherits System.Collections.CollectionBase Public Overridable Sub Add(ByVal Item As MyItem) list.Add(aItem) End Sub Public Overridable Sub Insert(ByVal Item As MyItem, ByVal location As Integer) list.Insert(location, aItem) End Sub Public Overridable Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New IndexOutOfRangeException() Else list.RemoveAt(index) End If End Sub Public Overridable Function Replace(ByVal index As Integer, ByVal aItem As MyItem If index > Count - 1 Or index < 0 Then Throw New IndexOutOfRangeException() Else list.Item(index) = aItem End If End Function Default Public ReadOnly Property Item(ByVal index As Integer) As MyItem Get If index < list.Count And index >= 0 Then Return CType(list.Item(index), MyItem) Else Throw New IndexOutOfRangeException() End If End Get End Property End Class
-
From the MySQL Docs online at: http://dev.mysql.com/doc/mysql/en/comparison-operators.html expr BETWEEN min AND max If expr is greater than or equal to min and expr is less than or equal to max, BETWEEN returns 1, otherwise it returns 0. This is equivalent to the expression (min <= expr AND expr <= max) if all the arguments are of the same type. Otherwise type conversion takes place according to the rules described at the beginning of this section, but applied to all the three arguments. Note: Before MySQL 4.0.5, arguments were converted to the type of expr instead. mysql> SELECT 1 BETWEEN 2 AND 3; -> 0 mysql> SELECT 'b' BETWEEN 'a' AND 'c'; -> 1 mysql> SELECT 2 BETWEEN 2 AND '3'; -> 1 mysql> SELECT 2 BETWEEN 2 AND 'x-3'; -> 0 So, I would assume that your syntax is correct. B.
-
Use.... Parameters..... Or.. Read the MySql documentation. DATE / DATETIME fields in mysql are stored in the format: 'YYYY-MM-DD HH:MM:SS.xx' as a *STRING* Therefore, the ToString() function of cbx_date1.Value (which is being implicitly returned) will return something to the ilk of: 'MM/DD/YYYY HH:MM:SS.xx' As you see, if you look closely.. those won't EVER compare correctly.. so.. 1. Use parameters 2. Write a function to convert a .NET Date/Time to a MySql Compatible Date/Time p.s. - the actual answer to the delimiting question - MySQL uses ''s to delimit a date, not ##'s
-
If the grid can be made read only, do so: myGrid.ReadOnly = True. Otherwise, you need to set up a DataView: (from memory): Dim dv as New DataView(YourDataTable_or_YourDataSet) dv.AddNew = False MyGrid.Datasource = dv B.
-
Yes Not an issue - it does create it. If dt.Rows.Count > 0 Then ' your code here End If
-
Uploading a dataset.datatable upto a database table.
penfold69 replied to mike55's topic in Database / XML / Reporting
Assuming SQL Server: Dim conn as New SqlConnection("yourconnectionstring") Dim comm as New SqlCommand("SQL Statement to retrieve values from database", conn) Dim rs as New SqlDataAdapter(comm) Dim cb as New SqlCommandBuilder(rs) Dim dt as New DataTable rs.Fill(dt) ' modify your data in the datatable, add rows, delete rows etc. ' then rs.Update(dt) ' (This will make all the changes in your Datatable effective in the database) rs.dispose() cb.dispose() comm.dispose() conn.close() conn.dispose() (all from memory, e&oe :P) B. -
It might be to do with their screen font size (Large Fonts/Small Fonts) so I'd set your machine to view Large fonts first and test accordingly. Found under: Control Panel->Display->Appearance->Font Size (in XP) B.
-
ZX81-Basic -> BBC Basic -> GWBasic -> QBasic -> C/C++/VB3/COBOL/PASCAL -> Delphi/VB4-6/C++/Java/ASP -> VB.NET/C#.Net In all.. about.. err... however long since the ZX81 came out! (yeah, I had a 16k upgrade brick too!) B.
-
Go and download the MySql Connector/Net from: http://dev.mysql.com/downloads/connector/net/1.0.html Install the product, and add a reference to the MySql.Data.Dll file to your project. From then on, you can use MySqlConnection/MySqlCommand/MySqlDataReader/MySqlDataAdapter in exactly the wsame way that you use OleDBConnection/OleDbCommand etc.. when you .Open() a MySqlConnection, you will need to pass various pieces of information into it. An example connection string might be: "Server=YourMysqlServer;username=DatabaseUser;password=GoAwayAndDie;database=YourDatabaseName;persist security info=true;compress=true;pooling=true" B.
-
If you mean the column caption text, when right aligned, I generally append a space, followed by the pipe character: eg: myDataColumn.HeaderText = "Price |"
-
A slightly neater way of doing this. Try Dim dIssue As New Date(Issue_Year.SelectedValue, Issue_Month.SelectedValue, Issue_Day.SelectedValue) Dim dReturned As New Date(ReturnedDate_Year.SelectedValue, ReturnedDate_Month.SelectedValue, ReturnedDate_Day.SelectedValue) lbl1.Text = dReturned.ToShortDateString() lbl2.Text = dIssue.ToShortDateString() Catch Ex as ArgumentOutOfRangeException ' Information input was invalid date - eg 31/02/2004 Catch Ex As Exception ' Some other problem End Try B.
-
MySQL "SELECT TOP x * FROM" question
penfold69 replied to EFileTahi-A's topic in Database / XML / Reporting
SELECT * FROM InDocLin LIMIT 100 -
Extend your point class to implement IComparable. Provide an override to CompareTo that implements IComparable.CompareTo The CompareTo function should return a comparison between your X Values (excuse VB.Net code, but you should be able to convert) Public Class Point Implements IComparable Public x As Integer Public y As Integer Overridable Function CompareTo(ByVal obj As Object) As Integer Implements IComparable.CompareTo If TypeOf obj Is Point Then Dim pt As Point = CType(obj, Point) Return x.CompareTo(pt.x) End If End Function End Class Then, you can simply use: Array.Sort(YourArrayName) This will use the in-built .NET sort functions, which are pretty efficient. I'm sure there are other ways to do this, but this is actually the easiest to create and maintain, certainly for me! B.