- ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.
- ExecuteReader is used for any result set with multiple rows/columns (e.g., SELECT col1, col2 from sometable).
- ExecuteNonQuery is typically used for SQL statements without results (e.g., UPDATE, INSERT, etc.).
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.Odbc; using System.IO; namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } OdbcDataAdapter da; DataSet ds; int i = 0; int j; OdbcConnection conn; int last; private ...
Comments
Post a Comment