Search Results

Search found 3342 results on 134 pages for 'wish you all peace'.

Page 3/134 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to prevent a hacked-server from spoofing a master server?

    - by Cody Smith
    I wish to setup a room-based multilayer game model where players may host matches and serve as host (IE the server with authoritative power). I wish to host a master server which tracks player's items, rank, cash, exp, etc. In such a model, how can I prevent someone that is hosting a game (with a modified server) from spoofing the master server with invalid match results, thus gaining exp, money or rankings. Thanks. -Cody

    Read the article

  • Fill Combo-box via DataSource Using Values from Various Columns

    - by peace
    Employee emp = new Employee(); comHandledBySQt.DataSource = emp.GetDataFromTable("1"); comHandledBySQt.DisplayMember = "FirstName"; The above code displays drop list of employees first names in a combo box. I want first name and last name to be displayed. How can i do it? I tried to include two columns FirstName and LastName as below but didn't work. comHandledBySQt.DisplayMember = "FirstName" + " " + "LastName"; Any help will be appreciated.

    Read the article

  • How Can I Choose Appropriate ComboBox Value Based on Select ListView Record? - C#.NET

    - by peace
    Contact Title has a default value which is Sales Person. Anyhow, when a user click Edit on the chosen ListView record, i need Contact Title to have the right value that corresponds to the chosen record. For example, if user clicks edit, the fields on the left side will be filled with values. In this case, i want Contact Title to view the right value. How can i do it? I hope my question is clear enough.

    Read the article

  • How to Get a Specific Column Value from a DataTable? - C#.NET Winforms

    - by peace
    I have a datatable. I need to fetch a certain column value based on the user input. For example, lets say the datatable has two columns CountryID and CountryName. I need to find CountryID in the datatable based on the user input country name. I could just open a connection with DB and run the query select countryID from Country where countryName = @userinput. Is there anyway i could do this on the datatable. Thanks

    Read the article

  • Do Instances Share Same Services? - SQL Server

    - by peace
    Lets say i installed two named SQL Server 2008 instances e.g. A and B, will i have two services of each type e.g. two analysis service, two reporting service and so on, one service for A and the other for B? If yes, then it is known a service listens on a port number, how two same services going to listen on the port? I hope this is clear enough. Thanks

    Read the article

  • Question About TransactionScope in .NET

    - by peace
    using (TransactionScope scope = new TransactionScope()) { int updatedRows1 = custPh.Update(cust.CustomerID, tempPh1, 0); int updatedRows2 = custPh.Update(cust.CustomerID, tempPh2, 1); int updatedRows3 = cust.Update(); if (updatedRows1 > 0 && updatedRows2 > 0 && updatedRows3 > 0) { scope.Complete(); } } Is the above TransactionScope code structured correctly? This is my first time using it so i'm trying to make as simple as i can.

    Read the article

  • Convert Null Value to String - C#.NET

    - by peace
    foreach (PropertyInfo PropertyItem in this.GetType().GetProperties()) { PropertyItem.SetValue(this, objDataTable.Rows[0][PropertyItem.Name.ToString()], null); } In one of the loops i get this exceptional error: Object of type 'System.DBNull' cannot be converted to type 'System.String'. The error occurs because one of the fields in the database has no value (null), so the string property could not handle it. How can i convert this null to string? I got this solution If you know a shorter or better one, feel free to post it. I'm trying to avoid checking on every loop is current value is null or not.

    Read the article

  • Load an html table from a mysql database when an onChange event is triggered from a select tag

    - by Crew Peace
    So, here's the deal. I have an html table that I want to populate. Specificaly the first row is the one that is filled with elements from a mysql database. To be exact, the table is a questionnaire about mobile phones. The first row is the header where the cellphone names are loaded from the database. There is also a select tag that has company names as options in it. I need to trigger an onChange event on the select tag to reload the page and refill the first row with the new names of mobiles from the company that is currently selected in the dropdown list. This is what my select almost looks like: <select name="select" class="companies" onChange="reloadPageWithNewElements()"> <?php $sql = "SELECT cname FROM companies;"; $rs = mysql_query($sql); while($row = mysql_fetch_array($rs)) { echo "<option value=\"".$row['cname']."\">".$row['cname']."</option>\n "; } ?> </select> So... is there a way to refresh this page with onChange and pass the selected value to the same page again and assign it in a new php variable so i can do the query i need to fill my table? <?php //$mobileCompanies = $_GET["selectedValue"]; $sql = "SELECT mname FROM ".$mobileCompanies.";"; $rs = mysql_query($sql); while ($row = mysql_fetch_array($rs)) { echo "<td><div class=\"q1\">".$row['mname']."</div></td>"; } ?> something like this. (The reloadPageWithNewElements() and selectedValue are just an idea for now)

    Read the article

  • How Can I Generate Random Unqiue Numbers in C#

    - by peace
    public int GenPurchaseOrderNum() { Random random = new Random(); _uniqueNum = random.Next(13287, 21439); return UniqueNum; } I removed unique constraint from the PONumber column in the db because an employee should only generate P.O. # when the deal is set. Otherwise, P.O. # would have 0. P.O. Number used to have unique constraint, this forces employee to generate P.O. in all cases so the db doesn't throw unique constraint error. Since i removed the unique constraint, any quote doesn't have P.O. will carry 0 value. Otherwise, a unique value is generated for P.O. #. However, i don't have a unique constraint in db which makes it hard for me to know whether the application generated P.O. # is unique or not. What should i do? I hope my question is clear enough

    Read the article

  • How to Get a Specific Column Value from a DataTable?

    - by peace
    I have a datatable. I need to fetch a certain column value based on the user input. For example, lets say the datatable has two columns CountryID and CountryName. I need to find CountryID in the datatable based on the user input country name. I could just open a connection with DB and run the query select countryID from Country where countryName = @userinput. Is there anyway i could do this on the datatable.

    Read the article

  • How Pick a Column Value from a ListView Row - C#.NET

    - by peace
    How can i fetch the value 500 to a variable from the selected row? One solution would be to get the row position number and then the CustomerID position number. Can you please give a simple solution. SelectedItems means selected row and SubItems means the column values, so SelectedItem 0 and SubItem 0 would represent the value 500. Right? This is how i populate the listview: for (int i = 0; i < tempTable.Rows.Count; i++) { DataRow row = tempTable.Rows[i]; ListViewItem lvi = new ListViewItem(row["customerID"].ToString()); lvi.SubItems.Add(row["companyName"].ToString()); lvi.SubItems.Add(row["firstName"].ToString()); lvi.SubItems.Add(row["lastName"].ToString()); lstvRecordsCus.Items.Add(lvi); }

    Read the article

  • Insert a Join Statement - (Insert Data to Multiple Tables) - C#/SQL/T-SQL/.NET

    - by peace
    I have a Winform that has fields need to be filled by a user. All the fields doesn't belong to one table, the data will go to Customer table and CustomerPhone table, so i decided to do multiple inserts. I will insert appropriate data to CustomerPhone first then Insert the rest data to Customer table. Is it possible to Join an Insert OR Insert a Join? If show me a rough sample, i will be grateful. Many Thanks

    Read the article

  • JqueryUI serialize data not working on first record

    - by peace
    I am using jqueryUI v1.8. I have created a modal dialog form to edit records of a table. When the edit link on the record is clicked the record data is displayed on the form and the user edits the record. When the user submits this form the data is serialized and posted via ajax to update the database. This works well with all records except the first one. Nothing is posted to server for update only for the first record. alert(serializeddata); is empty. Similarly, The first form element in every record chosen for editing does not show the actual value the first time. Once you cancel editing and close the dialog and reopen you can see the fields accurate data. How do I resolve this?

    Read the article

  • How to Select Multiple Records from Multiple Tables at Once - SQL Server/C#/.NET/T-SQL

    - by peace
    I have two tables Customer and CustomerPhone. Customer usually has multiple phone numbers, so when i run select statement on customer 101, i will get multiple records due to the multiple phone numbers. As you see below all the "Phone" and "Fax" field belongs to CustomerPhone table. These are considered as two records in the CustomerPhone table whereas the rest of fields relate to Customer table which is a single record. What should i do to fill Phone and Fax field in this case? Should i run select statement on CustomerPhone first and then run select statement on Customer?

    Read the article

  • How to Solve this Error "Cannot convert lambda expression to type 'string' because it is not a deleg

    - by peace
    . I get this error: "Cannot convert lambda expression to type 'string' because it is not a delegate type" - keyword select become underlined in blue Can you please advice. Employee emp = new Employee(); comHandledBySQt.DataSource = from x in emp.GetDataFromTable("1") select new { x.Id, Name = x.FirstName + " " + x.LastName }; comHandledBySQt.DisplayMember = "Name"; comHandledBySQt.ValueMember = "Id"; Above code should displays drop list of employees first name and last name in a combo box

    Read the article

  • Update Multiple Tables at a Time - SQL Server/T-SQL

    - by peace
    I have two tables, Customer and CustomerPhone. Single record in Customer can have multiple CustomerPhone records. As you see in the image below, Phone and Fax resides in CustomerPhone table whereas the rest of the fields resides in Customer table. If user want to edits a customer record, obviously i will have to update the record in Customer table and at least two records from CustomerPhone (Phone and Fax). I could write two update statements, one Update customerPhone and the second update Customer table. Is there a better solution?

    Read the article

  • Update Statement Updates 0 Rows via the C# Winform Application?

    - by peace
    First of all, please help me out! I can not take this anymore. I could not find where the error is located. Here is my problem: I'm trying to update a row via c# winform application. The update query generated from the application is formatted correctly. I tested it in the sql server environment, it worked well. When i run it from the application i get 0 rows updated. Here is the snippet that generates the update statement using reflection - don't try to figure it out. Carry on reading after the code portion: public void Update(int cusID) { SqlCommand objSqlCommand = new SqlCommand(); Customer cust = new Customer(); string SQL = null; try { if ((cusID != 0)) { foreach (PropertyInfo PropertyItem in this.GetType().GetProperties()) { if (!(PropertyItem.Name.ToString() == cust.PKName)) { if (PropertyItem.Name.ToString() != "TableName") { if (SQL == null) { SQL = PropertyItem.Name.ToString() + " = @" + PropertyItem.Name.ToString(); } else { SQL = SQL + ", " + PropertyItem.Name.ToString() + " = @" + PropertyItem.Name.ToString(); } } else { break; } } } objSqlCommand.CommandText = "UPDATE " + this.TableName + " SET " + SQL + " WHERE " + cust.PKName + " = @cusID AND PhoneNumber = " + "'" + "@phNum" + "'"; foreach (PropertyInfo PropertyItem in this.GetType().GetProperties()) { if (!(PropertyItem.Name.ToString() == cust.PKName)) { if (PropertyItem.Name.ToString() != "TableName") { objSqlCommand.Parameters.AddWithValue("@" + PropertyItem.Name.ToString(), PropertyItem.GetValue(this, null)); } else { break; } } } objSqlCommand.Parameters.AddWithValue("@cusID", cusID); objSqlCommand.Parameters.AddWithValue("@phNum", this.PhoneNumber); DAL.ExecuteSQL(objSqlCommand); } else { //AppEventLog.AddWarning("Primary Key is not provided for Update.") } } catch (Exception ex) { //AppEventLog.AddError(ex.Message.ToString) } } This part below: objSqlCommand.CommandText = "UPDATE " + this.TableName + " SET " + SQL + " WHERE " + cust.PKName + " = @cusID AND PhoneNumber = " + "'" + "@phNum" + "'"; generates dml: UPDATE CustomerPhone SET PhoneTypeID = @PhoneTypeID, PhoneNumber = @PhoneNumber WHERE CustomerID = @cusID AND PhoneNumber = '@phNum' @PhoneTypeID and @PhoneNumber are gotten from two properties. We assigned the value to these properties in the presentation layer from the user input text box. The portion below where fetches the values: objSqlCommand.Parameters.AddWithValue("@" + PropertyItem.Name.ToString(), PropertyItem.GetValue(this, null)); The code below fills the values of WHERE: objSqlCommand.Parameters.AddWithValue("@cusID", cusID); objSqlCommand.Parameters.AddWithValue("@phNum", this.PhoneNumber); The final code should look as: UPDATE CustomerPhone SET PhoneTypeID = 7, PhoneNumber = 999444 WHERE CustomerID = 500 AND PhoneNumber = '911'; Phone type id is 7 - user value that is taken from text box Phone number is 999444 - user value that is taken from text box The above final update statement works on the sql environment, but when running via the application, the execute non query runs ok and gets 0 rows updated! I wonder why?

    Read the article

  • Lookups targeting merged cells - only returning value for first row

    - by Ian
    I have a master worksheet which contains data that I wish to link to another 'summary' sheet using a lookup. However, some of the cells whose data I wish to include in the summary sheet are merged across two or more adjacent rows. To be clear, the 'primary' column A that I am using in my formula in order to identify the target row does not contain merged cells, but the column from which I wish to return a value does. I have tried VLOOKUP and INDEX+MATCH. The problem is that the data is only returned for the first row's key, and the others return zero (as though the cell in the target column were blank, where actually it is merged). I have tried inelegant ways around this, e.g. using IF statements to try to find the top row of the merged cell. However, these don't work well if the order of values in the summary sheet is different from that in the master sheet, as well as being messy. Can this be done?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >