| | |
C# Random names
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2009
Posts: 2
Reputation:
Solved Threads: 0
Hello all! Looking for some help with this, I've been using a book to make an sql database to store names, and was hoping to use a button to randomly select any of the names in the database to be allocated to one of two machines. Also there is a checkbox, which if checked would mean that particular person will not be selected. Here is a picture of the GUI:
http://farm3.static.flickr.com/2689/...b76fa9c7_o.jpg
As for the code so far:
As you can see not much has happened since the GUI and database have been created... I am very lost at how to start the rest...
Thanks in advance to anyone who can help!
Cheers nathan
http://farm3.static.flickr.com/2689/...b76fa9c7_o.jpg
As for the code so far:
C# Syntax (Toggle Plain Text)
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace IttellaII { public partial class Form1 : Form { private readonly string[] NAMES = new string[] { }; public Form1() { InitializeComponent(); } private void pictureBox1_Click(object sender, EventArgs e) { MessageBox.Show("Machine List 1.0.0.\nWritten by: Nathan Sharpe","About"); } private void machineWorkersBindingNavigatorSaveItem_Click(object sender, EventArgs e) { this.Validate(); this.machineWorkersBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.machineListDBDataSet); } private void machineWorkersBindingNavigatorSaveItem_Click_1(object sender, EventArgs e) { this.Validate(); this.machineWorkersBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.machineListDBDataSet); } private void Form1_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'machineListDBDataSet.MachineWorkers' table. You can move, or remove it, as needed. this.machineWorkersTableAdapter.Fill(this.machineListDBDataSet.MachineWorkers); } private void btGenerateWorkers_Click_1(object sender, EventArgs e) { //MachineListDBDataSet.ToString; //Random.ReferenceEquals.OnClick Generate } } }
As you can see not much has happened since the GUI and database have been created... I am very lost at how to start the rest...
Thanks in advance to anyone who can help!
Cheers nathan
0
#3 29 Days Ago
If you want to select a random row from MS-SQL database then use,
text Syntax (Toggle Plain Text)
SELECT TOP 1 column FROM table ORDER BY NEWID()
•
•
Join Date: Nov 2009
Posts: 2
Reputation:
Solved Threads: 0
0
#4 28 Days Ago
•
•
•
•
Not sure what you are looking for. Are you wanting to load a table from your database containing the names and their availability (all of info already in table) and then randomly select two names from the table data having records marked/flagged as available?
Guess the check box is a simple 'if' statement, but I dont know the code for the button/combo boxes and how to generate random names for them...
Aaarrgggh! =)
![]() |
Similar Threads
- Forms Not Returning Correct Information (JavaScript / DHTML / AJAX)
- Forms (JSP)
- I need advice with my HijackThis log (Viruses, Spyware and other Nasties)
- invitation for Yahoo IM id's (Geeks' Lounge)
- lowercase chars (C)
- homepage hijack "Search for..." about:blank in address (Viruses, Spyware and other Nasties)
- Application Error 0x00000024 (Windows NT / 2000 / XP)
Other Threads in the C# Forum
- Previous Thread: Help with KeyPress?!
- Next Thread: PdfSharp class library
| Thread Tools | Search this Thread |
.net access ado.net algorithm alignment array barchart bitmap box broadcast buttons c# chat check checkbox client color combobox control conversion csharp custom customactiondata database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ hospitalmanagementsystems httpwebrequest image index input install java label list listbox listener mandelbrot math mouseclick mysql networking operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






