Im writing a windows c# form at the moment and after all the headaches of gettin my stored procedure to combine 2 tables from 2 databases from 2 servers that had different collations(.....yeh MASSIVE headache)ive hit another snag!
here's my form1 code, no where near completed, missing my try/catchs, methods etc.
Code:
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;
using System.Data.Sql;
using System.Data.SqlClient;
namespace RepSalesNetAnalysis
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string myConn = "Server=10.0.0.32,1435;" +
"Database=shaftdata;" +
"uid=steve;" +
"pwd=steve1;" +
"Connect Timeout=300;";
SqlConnection conn = new SqlConnection(myConn);
conn.Open();
SqlCommand Pareto = new SqlCommand();
Pareto.Connection = conn;
Pareto.CommandType = CommandType.StoredProcedure;
Pareto.CommandText = "AAlinkParetoOK";
BindingSource bindme = new BindingSource();
DataTable mytable = new DataTable();
SqlDataAdapter table1 = new SqlDataAdapter(Pareto);
SqlDataReader read = Pareto.ExecuteReader();
//table1.Fill(mytable);
TESTER.Text = "ok it worked";
conn.Close();
//bindme.DataSource = table1;
//dataGridView1.DataSource = bindme;
}
}
}
ive double checked my sql proc and it does work. so there somthing about me calling it that doesnt.
Any help would be excellent!
