Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
GeneralRe: Collections, plus collection of base type - concept Pin
DaveyM6917-Dec-11 2:15
professionalDaveyM6917-Dec-11 2:15 
AnswerRe: Collections, plus collection of base type - concept Pin
Luc Pattyn17-Dec-11 2:32
sitebuilderLuc Pattyn17-Dec-11 2:32 
GeneralRe: Collections, plus collection of base type - concept Pin
Luc Pattyn17-Dec-11 2:42
sitebuilderLuc Pattyn17-Dec-11 2:42 
AnswerRe: Collections, plus collection of base type - concept Pin
Luc Pattyn17-Dec-11 2:48
sitebuilderLuc Pattyn17-Dec-11 2:48 
GeneralRe: Collections, plus collection of base type - concept Pin
DaveyM6917-Dec-11 3:10
professionalDaveyM6917-Dec-11 3:10 
AnswerRe: Collections, plus collection of base type - concept Pin
Luc Pattyn17-Dec-11 3:50
sitebuilderLuc Pattyn17-Dec-11 3:50 
AnswerRe: Collections, plus collection of base type - concept Pin
BillWoodruff16-Dec-11 20:48
professionalBillWoodruff16-Dec-11 20:48 
QuestionBoundColumns Not Working Pin
AmbiguousName15-Dec-11 6:45
AmbiguousName15-Dec-11 6:45 
hello guys... I have this DB in which I insert, update and delete data successfully. But problem comes when I try to add my own columns in Datagridview (Columns: Collection) and use the same code to get the data in it. But this does not show data in the columns already there and adds the new columns instead. Here is the code that I am using.
C#
SqlConnection connection = new SqlConnection("Data Source=myServer; Initial Catalog=myDB; Integrated Security=True");
SqlDataAdapter adapter = new SqlDataAdapter("my SP name", connection);
DataTable dt = new DataTable();

try
{
  connection.Open();
  adapter.Fill(dt);
  dg1.DataSource = dt;
}
catch (Exception ex)
{ connection.close(); MessageBox.Show(ex.Message);}
finally
{ connection.Close(); }

What can I do to add my own columns, but get the same data there in my own columns. thnx
AnswerRe: BoundColumns Not Working Pin
PIEBALDconsult15-Dec-11 7:02
mvePIEBALDconsult15-Dec-11 7:02 
AnswerRe: BoundColumns Not Working Pin
SilimSayo15-Dec-11 13:34
SilimSayo15-Dec-11 13:34 
QuestionC# help? Pin
Brian Reiber15-Dec-11 5:50
Brian Reiber15-Dec-11 5:50 
AnswerRe: C# help? Pin
Paladin200015-Dec-11 6:14
Paladin200015-Dec-11 6:14 
GeneralRe: C# help? Pin
harold aptroot15-Dec-11 6:28
harold aptroot15-Dec-11 6:28 
AnswerRe: C# help? Pin
Richard MacCutchan15-Dec-11 6:29
mveRichard MacCutchan15-Dec-11 6:29 
AnswerRe: C# help? Pin
PIEBALDconsult15-Dec-11 6:36
mvePIEBALDconsult15-Dec-11 6:36 
AnswerRe: C# help? Pin
Deborah Palmer McCain15-Dec-11 8:34
Deborah Palmer McCain15-Dec-11 8:34 
GeneralRe: C# help? Pin
Richard MacCutchan15-Dec-11 22:23
mveRichard MacCutchan15-Dec-11 22:23 
GeneralRe: C# help? Pin
Deborah Palmer McCain16-Dec-11 6:35
Deborah Palmer McCain16-Dec-11 6:35 
AnswerRe: C# help? PinPopular
DaveyM6915-Dec-11 9:25
professionalDaveyM6915-Dec-11 9:25 
GeneralRe: C# help? Pin
Luc Pattyn15-Dec-11 19:59
sitebuilderLuc Pattyn15-Dec-11 19:59 
AnswerRe: C# help? Pin
gymmy15-Dec-11 12:31
gymmy15-Dec-11 12:31 
AnswerRe: C# help? Pin
DaveyM6915-Dec-11 13:18
professionalDaveyM6915-Dec-11 13:18 
QuestionC# question? Pin
Brian Reiber15-Dec-11 5:14
Brian Reiber15-Dec-11 5:14 
AnswerRe: C# question? Pin
DaveyM6915-Dec-11 5:32
professionalDaveyM6915-Dec-11 5:32 
AnswerRe: C# question? PinPopular
Pete O'Hanlon15-Dec-11 5:37
mvePete O'Hanlon15-Dec-11 5:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.