If anyone has any hints or a direction they can point me to, it will be appreciated.
The error I am getting now is
Error 1 An object reference is required for the non-static field, method, or property 'System.Windows.Forms.DataGridView.Rows.get'
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Odbc;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace RSQ_App_V1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
try
{
//Initialize variables
int contactsWaiting = 0;
//rtcsqssummary = callswaiting
int oldestContact = 0;
//rtcsqssummary = oldestcontact
int totalContacts = 0;
//rtcsqssummary = totalcalls
int contactsHandled = 0;
//rtcsqssummary = callshandled
int contactsAbandoned = 0;
//rtcsqssummary = callsabandoned
double percentageHandled = 0;
// Establishes Connection to UCCX
OdbcConnection connection = new OdbcConnection();
connection.ConnectionString = "DSN=UCCX";
// Selects Total Calls
string queryString = "SELECT totalcalls FROM rtcsqssummary WHERE csqname='RSQ-Spanish' OR csqname='RSQ-English'";
// Query Command
OdbcCommand command = new OdbcCommand(queryString, connection);
////Error Fails
//MessageBox.Show("IT Breaks after this....");
//Open Connection
connection.Open();
////Error Pass
//MessageBox.Show("You solved the connection issue!");
//Executes Data Reader
OdbcDataReader reader = command.ExecuteReader();
DataTable dt = new DataTable("UCCXData");
dt.Load(reader);
reader.Close();
connection.Close();
//fill the dataview
dvData.DataSource = dt;
textBox1.Text = DataGridView.Rows[1].Cells[1].Value;
}
catch (Exception ex)
{
MessageBox.Show("there was an error - " + ex);
textBox1.Text = " " + ex;
}
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'dataSet1.rtcsqssummary' table. You can move, or remove it, as needed.
this.rtcsqssummaryTableAdapter.Fill(this.dataSet1.rtcsqssummary);
}
}
}

New Topic/Question
Reply



MultiQuote





|