Get min, max and avg records from a database using SQL
I have a Student table in a database and that has smarks column. We can use SQL Min, Max and Avg functions to get minimum, maximum, and average values. I am using OleDb data provider to connect to the database.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace
Display_min_max_avg_records_in_textbox
{
public partial
class Form1
: Form
{
string ConnectionString =
System.Configuration.ConfigurationSettings.AppSettings["dsn"];
OleDbCommand com;
OleDbDataAdapter
oledbda;
DataSet ds = new DataSet();
string str;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object
sender, EventArgs e)
{
OleDbConnection con
= new OleDbConnection(ConnectionString);

J VsPosted Aug 5, 2019, 10:38 PM
Can you help me with this ? using access db.
Anil Kumar YadavPosted Aug 13, 2011, 2:52 AM
nice article.....friend.