Member Avatar

Hello. I have two tables in a database - Clubs and Players. Each Club consists of 25 players. So a virtual table ClubsPlayers is created. I would like to access this tables row or cell, but I don't know how. As you can access real tables like this: [code=C#] xDataSet.Clubs[1].IdClub; [/code]

Member Avatar
+0 forum 7
Member Avatar

Hi again! I have a database and some tables filled with data. [code=c#] var club = Baza.Clubs; //Baza is dataset, and Clubs is table var schedule = Baza.Schedule; // same as above for (int i = 1; i <= 90; i++) { if(schedule[i].day == 2) // BOOM! Breaks at first pass.. { //Do something.. } } [/code] When I run my app it throws me this error: There is no row at position 0 and throws me to dataSet.Designer.cs to this part of code: [code=c#] public ScheduleRow this[int index] { get { return ((ScheduleRow)(this.Rows[index])); } } [/code] Any ideas why …

Member Avatar
+0 forum 8
Member Avatar

Hello again. I have a property 'F' in class 'Club'. I realized that it doesn't function properly while going through debugging and locals. At first look it had normal, wanted values. BUT than every time I hovered over class->property F it increased by *2 or seomthing like that. Here's the code: [CODE=C#] class formation { private int[] frm = new int[7]; private int def, dmf, sb, smf, mid, amf, st; public int[] Formation { get { frm[0] = Sb; frm[1] = Def; frm[2] = Dmf; frm[3] = Smf; frm[4] = Mid; frm[5] = Amf; frm[6] = St; return frm; } …

Member Avatar
+0 forum 3
Member Avatar

Hello. I couldn't think of any better name for the title. To the point... I have this database reader method, and In the while loop, where the liga[] is being populated, all its values are the last that is read from DB.. Clubs ID are from 1 - 10 Any suggestions? [CODE=C#] private static bool readDatabase(ref string strError, Club[] liga) { bool blnRetVal = true; Player player = new Player(); Club club = new Club(); string selectSQL = "SELECT * FROM Players"; string selectClub = "SELECT * FROM Clubs"; try { using (OleDbConnection conn = new OleDbConnection(connectionString)) { conn.Open(); using …

Member Avatar
+0 forum 2
Member Avatar

Hello masters! I have a project and need a bit of your help. I would like to access/get values from certain fields from a database and assing that value to a variable. Database is included into my project along with DataSet. Is there any simple way to access certain field? Roughly, something like: String myString = ""; Database db = "C:\myDatabase.accdb"; myString = db.Tables["Table1"].Row[0].Cells[1];

Member Avatar
+0 forum 7
Member Avatar

Hello! I have a little problem. I don't understand how to solve this issue: Object reference not set to an instance of an object. Thank you! This is my code: [code=c#] BindingList<ComboBox> cmbPlayers = new BindingList<ComboBox>(); Club[] league = new Club[10]; // league contains class Club // class Club contains property Player[] (set as new Player[30]) // Players contains class Player // Player has property String Name private void cmbTacticsAddPlayers() { foreach (var cmb in cmbPlayers) { for (int i = 0; i <= league[0].Players.Length;i++ ) { cmb.Items.Add(league[0].Players[i].Name); // THROWS EXCEPTION } } } [/code]

Member Avatar
+0 forum 5
Member Avatar

Hello. I have a problem writing to a file using for loop. here is the code: [CODE=cpp] /* the code should save numbers in a file something like this 1 5 2 8 3 7 4 6 */ //instead it gives just the last numbers it catches /* 4 6 */ for(int i=0;i<=4;i++){ //some code before int iCom = (rand()%3+5); ofstream played("played.txt"); if (played.is_open()){ played << i << " " << iCom; played << endl; played.close(); } else cout << "Unable to save" << endl; } [/CODE] Thanks

Member Avatar
+0 forum 2
Member Avatar

Hi masters! I have a problem with my while loop. I realised that my code does not work the way I want. It has to check if sum of def, mid and att variables is different from 10 or if style variable is different from multiple strings. So if any of them does not meet the requirement, repeat the code in {} . My style condition which is repeated is interfering with other style conditions. So my question is - How to write this while loop (or it doesn't have to be while) to give me the thing I want? …

Member Avatar
+0 forum 3
Member Avatar

Hello everyone. I am working on my final project at university for C++, and I got stuck a little. I have an array inside an array. And I want to access that inner array's member and print it with cout. Here is the code: [code=c] void standings(userClub uc){ cout << endl; cout << "First Division" << endl; int table[10]; for(int i=0; i<=9; i++){ table[i] = coms[i].pts; } table[9]=uc.pts; sort(table, table+10); int y=9; while(y>=0){ cout << table[coms[y].name] << "\t"; // HERE I WANT TO ACCESS cout << table[y] << endl; // coms array y--; } } [/code] Please have in mind …

Member Avatar
+0 forum 3

The End.