Drill down and caption "New Data Set"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is a WinForm.
After the code below is executed, my data grid only shows a plus sign. I
click the plus sign and the word table is shown. I click on the word table,
and my columns are shown with the data from my SP.

How do I stop the plus sign, and the table word from coming up? How do I
stop the caption "New Data Set" at the top of my data grid?
 
I forgot to post my code, here it is.

private void frmDealerSearch_Load(object sender, System.EventArgs e)
{
string sConnString = "Data
Source=db;Database=License;Integrated Security=False;User
ID=sa;password=password";
string sProc = "prGet_DealerInfo";

using (SqlConnection oCn = new
SqlConnection(sConnString))
{
using (SqlCommand oCmd = new
SqlCommand(sProc, oCn))
{
oCn.Open();
oCmd.CommandType =
CommandType.StoredProcedure;

oCmd.Parameters.Add("@sDealerNum",
SqlDbType.NChar, 6);
oCmd.Parameters["@sDealerNum"].Value
= "900001";

SqlDataAdapter oDa = new
SqlDataAdapter();

oDa.SelectCommand = oCmd;
DataSet ds=new DataSet();
oDa.Fill(ds);
dgDealerInfo.DataSource = ds;
}
}

}
 
Hi,

[Inline]

Mike L said:
I forgot to post my code, here it is.

private void frmDealerSearch_Load(object sender, System.EventArgs e)
{
string sConnString = "Data
Source=db;Database=License;Integrated Security=False;User
ID=sa;password=password";
string sProc = "prGet_DealerInfo";

using (SqlConnection oCn = new
SqlConnection(sConnString))
{
using (SqlCommand oCmd = new
SqlCommand(sProc, oCn))
{
oCn.Open();
oCmd.CommandType =
CommandType.StoredProcedure;

oCmd.Parameters.Add("@sDealerNum",
SqlDbType.NChar, 6);

oCmd.Parameters["@sDealerNum"].Value
= "900001";

SqlDataAdapter oDa = new
SqlDataAdapter();

oDa.SelectCommand = oCmd;
DataSet ds=new DataSet();
oDa.Fill(ds);
dgDealerInfo.DataSource = ds;

Change to dgDealerInfo.DataSource = ds.Tables[0];
---OR---
Use dgDealerInfo.DataMember to set the table name, which is presumable
"table" if that's what you saw.

HTH,
Greetings
 
Hi Cadel,

Does "Bart Mermuys"'s reply make sense to you? Is your problem resolved?
Please feel free to feedback, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top