Click here to Skip to main content
15,890,882 members
Home / Discussions / C#
   

C#

 
Questionhow to calculate other forms textbox values from one form in c#? Pin
v surya dev6-Feb-12 19:46
v surya dev6-Feb-12 19:46 
AnswerRe: how to calculate other forms textbox values from one form in c#? Pin
Abhinav S6-Feb-12 20:09
Abhinav S6-Feb-12 20:09 
AnswerRe: how to calculate other forms textbox values from one form in c#? Pin
AmbiguousName6-Feb-12 20:17
AmbiguousName6-Feb-12 20:17 
GeneralRe: how to calculate other forms textbox values from one form in c#? Pin
v surya dev7-Feb-12 5:31
v surya dev7-Feb-12 5:31 
AnswerRe: how to calculate other forms textbox values from one form in c#? Pin
BillWoodruff7-Feb-12 15:17
professionalBillWoodruff7-Feb-12 15:17 
QuestionBasic ComboBox Problem :( Pin
AmbiguousName6-Feb-12 18:58
AmbiguousName6-Feb-12 18:58 
AnswerRe: Basic ComboBox Problem :( Pin
Abhinav S6-Feb-12 19:07
Abhinav S6-Feb-12 19:07 
GeneralRe: Basic ComboBox Problem :( Pin
AmbiguousName6-Feb-12 19:21
AmbiguousName6-Feb-12 19:21 
Actually I am setting values of all the dropdowns in the same functions, so I had to copy/paste the code. Here is the code

<pre lang="c#">
private void LoadStudents()
{
StringBuilder sb = new StringBuilder();

DataTable dt = GetStudentsList(); //get data from database
DataTable dt2 = MakeTable(); //to insert concatenated NAMEs with IDs

for (int i = 0; i < dt.Rows.Count; i++)
{
// concatinate id with name
sb.Append(dt.Rows[i][0].ToString().Trim());
sb.Append(" --- ");
sb.Append(dt.Rows[i][1].ToString().Trim());

string studentName = sb.ToString();

dt2.Rows.Add(studentName );
sb.Clear();
}
LoadAccountsIntoCombos(dt2);
}

private void LoadAccountsIntoCombos(DataTable dt2)
{
//Show Students
combo1.DataSource = dt2;
combo1.DisplayMember = "StudentName";
combo1.SelectedIndex = 0;

combo2.DataSource = dt2;
combo2.DisplayMember = "StudentName";
combo2.SelectedIndex = 0;

combo3.DataSource = dt2;
combo3.DisplayMember = "StudentName";
combo3.SelectedIndex = 0;
}
</pre>
GeneralRe: Basic ComboBox Problem :( Pin
Mycroft Holmes6-Feb-12 19:49
professionalMycroft Holmes6-Feb-12 19:49 
GeneralRe: Basic ComboBox Problem :( Pin
Abhinav S6-Feb-12 20:07
Abhinav S6-Feb-12 20:07 
GeneralRe: Basic ComboBox Problem :( Pin
AmbiguousName6-Feb-12 20:09
AmbiguousName6-Feb-12 20:09 
NewsRe: Basic ComboBox Problem :( Pin
V.6-Feb-12 21:38
professionalV.6-Feb-12 21:38 
GeneralRe: Basic ComboBox Problem :( Pin
BobJanova6-Feb-12 22:21
BobJanova6-Feb-12 22:21 
GeneralRe: Basic ComboBox Problem :( Pin
Mycroft Holmes6-Feb-12 23:56
professionalMycroft Holmes6-Feb-12 23:56 
GeneralRe: Basic ComboBox Problem :( Pin
BobJanova8-Feb-12 4:05
BobJanova8-Feb-12 4:05 
AnswerRe: Basic ComboBox Problem :( Pin
Luc Pattyn7-Feb-12 0:20
sitebuilderLuc Pattyn7-Feb-12 0:20 
GeneralRe: Basic ComboBox Problem :( Pin
ProEnggSoft7-Feb-12 6:25
ProEnggSoft7-Feb-12 6:25 
Questionhow to get names and count of tables Pin
phowarso6-Feb-12 17:25
phowarso6-Feb-12 17:25 
AnswerRe: how to get names and count of tables Pin
PIEBALDconsult6-Feb-12 18:08
mvePIEBALDconsult6-Feb-12 18:08 
GeneralRe: how to get names and count of tables Pin
Mycroft Holmes6-Feb-12 19:43
professionalMycroft Holmes6-Feb-12 19:43 
GeneralRe: how to get names and count of tables Pin
PIEBALDconsult7-Feb-12 2:32
mvePIEBALDconsult7-Feb-12 2:32 
AnswerRe: how to get names and count of tables Pin
Abhinav S6-Feb-12 19:10
Abhinav S6-Feb-12 19:10 
QuestionGarbage collection & nested objects? Pin
SledgeHammer016-Feb-12 11:17
SledgeHammer016-Feb-12 11:17 
AnswerRe: Garbage collection & nested objects? Pin
Eddy Vluggen6-Feb-12 11:38
professionalEddy Vluggen6-Feb-12 11:38 
AnswerRe: Garbage collection & nested objects? Pin
harold aptroot6-Feb-12 11:41
harold aptroot6-Feb-12 11:41 

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.