Hi guys,
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.
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=fake;" +
"Database=shaftdata;" +
"uid=fake;" +
"pwd=fake;" +
"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;
}
}
}
i seem to connect no problem, i seem to create my adapters no problem but when i call my stored procedure no data is put into my table(ignore my commented out lines, they are part of my debugging).
ive double checked my sql proc and it does work. so there somthing about me calling it that doesnt.
Any help would be excellent!