Click here to Skip to main content
16,007,779 members
Home / Discussions / C#
   

C#

 
QuestionChange properties with button Pin
Dave McCool22-Feb-06 22:14
Dave McCool22-Feb-06 22:14 
AnswerRe: Change properties with button Pin
hooray22-Feb-06 22:24
hooray22-Feb-06 22:24 
Questiondate function Pin
ptvce22-Feb-06 20:52
ptvce22-Feb-06 20:52 
AnswerRe: date function Pin
Guffa23-Feb-06 2:22
Guffa23-Feb-06 2:22 
QuestionBind Data in a DataGrid Using DataReader Pin
sivakumarUSTRI22-Feb-06 20:22
sivakumarUSTRI22-Feb-06 20:22 
AnswerRe: Bind Data in a DataGrid Using DataReader Pin
Acheive_it22-Feb-06 22:47
Acheive_it22-Feb-06 22:47 
AnswerRe: Bind Data in a DataGrid Using DataReader Pin
goyal manish22-Feb-06 23:32
goyal manish22-Feb-06 23:32 
QuestionC# .Net 2005 - Question about .Row.Add(new object[]{...,...}) Please help! Pin
JC Carmo22-Feb-06 20:19
JC Carmo22-Feb-06 20:19 
Hello everyone,

Greetings from Brazil! As shown in the code below, is it possible for me to add the new objects for tipoDT and sementesDT without having to do it one-by-one? Like, for example, getting the values automatically from the tables?.... How would I do that? The sementesDT table is quite large and would take me forever to add the new objects one-by-one! Here's the code:

public frmBA()
{
tipoDT = new DataTable("tabTipoSemente");
tipoDT.Columns.Add("CodTipo", typeof(int));
tipoDT.Columns.Add("Tipo", typeof(string));

tipoDT.Rows.Add(new object[] { 0, "Nocivas Probidas" });
tipoDT.Rows.Add(new object[] { 1, "Nocivas Toleradas" });
tipoDT.Rows.Add(new object[] { 2, "Sementes Silvestres" });

sementesDT = new DataTable("tabSementes");
sementesDT.Columns.Add("CodSemente", typeof(int));
sementesDT.Columns.Add("CodTipo", typeof(int));
sementesDT.Columns.Add("Semente", typeof(string));

sementesDT.Rows.Add(new object[] { 0, 0, "SubCat0-Cat0" });
sementesDT.Rows.Add(new object[] { 1, 0, "SubCat1-Cat0" });
sementesDT.Rows.Add(new object[] { 2, 0, "SubCat2-Cat0" });
sementesDT.Rows.Add(new object[] { 3, 1, "SubCat3-Cat1" });
sementesDT.Rows.Add(new object[] { 4, 1, "SubCat4-Cat1" });
sementesDT.Rows.Add(new object[] { 5, 1, "SubCat5-Cat1" });
sementesDT.Rows.Add(new object[] { 6, 2, "SubCat6-Cat2" });
sementesDT.Rows.Add(new object[] { 7, 2, "SubCat7-Cat2" });
sementesDT.Rows.Add(new object[] { 8, 2, "SubCat8-Cat2" });

InitializeComponent();

tipoBS = new BindingSource();
tipoBS.DataSource = tipoDT;
TipoComboBoxColumn.DataSource = tipoBS;
TipoComboBoxColumn.DisplayMember = "Tipo";
TipoComboBoxColumn.ValueMember = "CodTipo";

unfilteredSementesBS = new BindingSource();
DataView undv = new DataView(sementesDT);
unfilteredSementesBS.DataSource = undv;
EspecieComboBoxColumn.DataSource = unfilteredSementesBS;
EspecieComboBoxColumn.DisplayMember = "Semente";
EspecieComboBoxColumn.ValueMember = "CodTipo";

filteredSementesBS = new BindingSource();
DataView dv = new DataView(sementesDT);
filteredSementesBS.DataSource = dv;
}


Thank you very much for your attention, time and help and I'm looking forward to your reply.

Best regards,

JC Carmo Smile | :)

AnswerRe: C# .Net 2005 - Question about .Row.Add(new object[]{...,...}) Please help! Pin
Christian Graus22-Feb-06 20:37
protectorChristian Graus22-Feb-06 20:37 
QuestionRe: C# .Net 2005 - Question about .Row.Add(new object[]{...,...}) Please help! Pin
JC Carmo22-Feb-06 20:42
JC Carmo22-Feb-06 20:42 
AnswerRe: C# .Net 2005 - Question about .Row.Add(new object[]{...,...}) Please help! Pin
Christian Graus22-Feb-06 20:47
protectorChristian Graus22-Feb-06 20:47 
GeneralRe: C# .Net 2005 - Question about .Row.Add(new object[]{...,...}) Please help! Pin
JC Carmo22-Feb-06 20:53
JC Carmo22-Feb-06 20:53 
GeneralRe: C# .Net 2005 - Question about .Row.Add(new object[]{...,...}) Please help! Pin
Christian Graus22-Feb-06 20:56
protectorChristian Graus22-Feb-06 20:56 
QuestionGeneate XML file from Excel Worksheet----Urgent Help me Pls Pin
winpoorni22-Feb-06 20:15
winpoorni22-Feb-06 20:15 
AnswerRe: Geneate XML file from Excel Worksheet----Urgent Help me Pls Pin
veeru_syd27-Feb-06 12:55
veeru_syd27-Feb-06 12:55 
QuestionHow to set DataGridViewButtonColumn 's Enabled Pin
renmudi22-Feb-06 20:05
renmudi22-Feb-06 20:05 
QuestionPrinting using WMI Pin
raheeli22-Feb-06 20:04
raheeli22-Feb-06 20:04 
QuestionAdd Icon to Menu Item Pin
Praveen_S22-Feb-06 20:04
Praveen_S22-Feb-06 20:04 
QuestionHow to create simple boolean property for usercontrol, so, that it shows in IDE property page? Pin
Oskars22-Feb-06 19:43
Oskars22-Feb-06 19:43 
AnswerRe: How to create simple boolean property for usercontrol, so, that it shows in IDE property page? Pin
Praveen Nayak23-Feb-06 19:49
Praveen Nayak23-Feb-06 19:49 
QuestionRedirecting Std Input, Output and Error Pin
Dribble22-Feb-06 19:34
Dribble22-Feb-06 19:34 
QuestionMySQL vs. SQL Server Pin
Expert Coming22-Feb-06 19:30
Expert Coming22-Feb-06 19:30 
AnswerRe: MySQL vs. SQL Server Pin
emran83422-Feb-06 19:40
emran83422-Feb-06 19:40 
GeneralRe: MySQL vs. SQL Server Pin
Expert Coming22-Feb-06 19:42
Expert Coming22-Feb-06 19:42 
GeneralRe: MySQL vs. SQL Server Pin
emran83422-Feb-06 19:50
emran83422-Feb-06 19:50 

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.