1,469 Posted Topics
Re: In comparing, you can only use two types of operators: != (not equal) and == (equl). You cannot use <=, >= becuase these are for numeric comparations. Or an example from Adapost (which in my opinion is a great one - HashCode is some of a unique key of the … | |
Re: I did an example code how you can itterate through textBoxes on enter key press. NOTE: my example uses only 3 textbox controls. If your have more, please enter all of them into textBox array!! Code: [CODE] Public Partial Class Form1 Inherits Form Private tbs As TextBox() Public Sub New() … | |
Re: abelLazem showed you on the picture where to look for Designer class of the Form. If you havent delete the whole form class, it shoud be there. | |
Re: As SethWebster explained, you return an array. If there are more value with different type (int, decimal, string, ...) you return an object array. If there are all the values of the same type, you can return the same type: [CODE] public int[] Returnmethod() { int a = 1; int … | |
Re: Ans what will this program be about? You can start reading books (better way to get started) or read MSDN`s help (type C# msdn in goodle) on internet. | |
Hi, since this forum has been modified majorly (this happened approx. 6 months ago) nothing works at it should. There is a lot less people asking question (and answering on them), it seems like you have driven them away with these (not-good changes -personally it was whole much better before … | |
Re: [QUOTE=navachaitanya;1576108]i need is if select 30days membership then expiry date to be generated from joining date with type of membership (i.e month,quartly,half-yearly,yearly)[/QUOTE] Can you please say some more about this type of membership(month, quarty, half-yearly, yearly)? What are they suppose to meanm I mean what is their purpose in here? | |
Re: Why dont you use a normal TextBox control instead of MaskeTextBox? In IP case, it would be a better option. --- Anyway, if you would like to use MaskeTextBox, and if you wanna remove spaces use Replace method of string class: string input = "23 .1 .001.200"; if (input.Contains(" ")) … | |
I have a small problem with printing reports (made by crystal reports). In Form1 I have a list of customers in a ListView (with checkboxes). If the users selects one customer (checkes ONE checkBox) the report is shown - and the report it self has on option to print. If … | |
Re: You cannot access control which were creates on one (usually on UI) thread, from another thread. You will need to Invoke control. For more info read here: http://msdn.microsoft.com/en-us/library/zyzhdc6b.aspx FOr example to clear selection do: listBox1..Invoke(() => listBox1.ClearSelection()); | |
Re: DO NOT make controls public. This is the worse case possible. This is never a good way of (unsafe) coding. You have other better options: - by creating a method on form1 which can be access from form2 to access control on form2 - by using events but in any … | |
Re: Put all of the data into a genetric list, and then do some linq query with using Distinct() extension method. One more thing, what exactly is your datasource? | |
Re: This code: if(RadioButton1.Checked) { Form2 f2 = new Form2(); f2.Show(); } else if (RadioButton2.Checked) { // do something else } | |
Re: Use int.Parse() method: if (int.Parse(row.Cells[3].Value.ToString()) >= -1) { //do work... } | |
Re: If you bind some data from the dataSource to DGV control, **Remove** the row from the datasource, not from the DGV. This will reflest in removing row from DGV as well. | |
Re: How do you intend to pass the data from DGV to textBox? On a row (cell) click? Some other way? If so, do it like: textBox1.Text = dgv[ColumnIndex, RowIndex].Value.ToString(); if you want to add data to textBox (multiline) use += insted of = only and add "\r\n" before code: textBox1.Text … | |
Re: Do the loop through the rows of dgv and check if row is selected: using(SqlConnection conn = new SqlConnection("connString")) { foreach (DataGridViewRow dr in dataGridView2.Rows) { DataGridViewCheckBoxCell check = row.Cells[0] as DataGridViewCheckBoxCell; if(check != null && (bool)check.Value) //1st parameter must not be null, 2nd parameter must me true! { string … | |
Re: Have you set column names? And I would suggest you to set View to Details, not to List or any other type. | |
Re: Hi, Would you mind showing as some code? Check here this link if it helps: http://irslab.blogspot.com/2010/07/aforgenet-color-filter-c.html thx | |
Re: Hi, can you show us your code? No need to paste it all here, but only the basic one, so we can see whats all about. thx | |
Re: Hi [CODE] string[] wordsArray = { "a", "bb", "ccc", "d", "ee", "f", "ggg" }; for (int pass = 0; pass < wordsArray.Length; pass++) { for (int j = 0; j <= wordsArray.Length - 2; j++) { if (wordsArray[j] > wordsArray[j + 1]) //when you come the last character of the … | |
Re: I would suggest you to use events. | |
Re: Hi, read here: http://www.articlesbase.com/operating-systems-articles/5-simple-ways-to-speed-up-windows-internet-connection-346007.html Maybe you find something interesting. | |
Re: Retreive the id from the selected tiem, by using DataRowView class: DataRowView view = comboBox1.SelectedItem as DataRowView; int id = int.Parse(view["IdColumnName"].ToString()); //us id variable as a value to insert to db. | |
Re: Hi, how do you add to table1 from dgv2? My guess is that you add 2 more columns, instead of adding data to 1st and 2nd columns only (so bellow the previous data). | |
Re: Use StreamReader to read line by line (rows), and a comma delimiter to split each line (columns). Then you can for each row do insert or update into database, since you have all the values of a row. Hope it helps. | |
Re: On every step of the way through the method the code must return some value, if it cannot continue from there. So every if, else if and else must return it. | |
Re: You only need the correct [connection string](http://www.connectionstrings.com/) to access to database. And if SSMS (with database) is located on different pc, then you have to open a 1433 port (potr that is used to access to sql server by defalut) in the firewall. | |
Re: DO: //on main form: void OpenClient() { Client c = new Client(this); c.DoWork(); } public void AddText(string text) { this.richTextBox1.AppendText(text+Environment.NewLine); } //on client class: class Client { MainForm mf; public Client(MainForm _mf) { this.mf = _mf; } public DoWork() { string text = ""; //do some work ... and add … | |
Re: You cannot remove items while inisde loops, nor for or foreach loop. You will have to create a new list, where you will put numbers to delete, or indexes of them, and then add the duplicates inside out it. After this is done, you will have to do another loop … | |
Re: Multiply? Do you mean, when you select an item on comboBox1, you ADD this item to comboBox2? Is fo, use Add() method. comboBox2.Items.Add(comobBox1.SelectedItem) | |
Re: When exactly do you wanna clear it? When you click on it, or double click on it? PS: Create specific event where you wanna do that exactly. | |
Re: Or I would use sb.AppendLine(line); This will put lines into each line (same as in file). | |
Re: Add parameters to the OldCommand and use the correct values for each of them (you said you have comboBoxes (in your upper example are textBoxes). This is the code that should work: [CODE] Dim conn As New OleDbConnection("provider=microsoft.jet.OleDB.4.0;Data Source=" + Application.StartupPath & "\database.mdb") Dim sql As String = String.Empty sql … | |
Re: What exactly do you have in mind? Maybe you want to create a derived class from a base class, and use a new keyword on a return type. Check here: http://www.akadia.com/services/dotnet_polymorphism.html | |
Re: For the 1st part (checking username and password match) you can do the same as for login check (you can even use that code). For last one, to check if two passowrds are equal (in textboxes) simply do: if(textBoxPswd1.Text == textBoxPswd2.Text) { //passwords both equal, so continue } else { … | |
Re: If the file is "in-use", you cannot delete it. | |
Re: Mate, tell us what EXACTLY IS that you want from the filering. Select query is doing EXACTLY what you tell it. And it does 100% fine. The problem is only in your string. To blindly guess what do you need is: string strSelect = string.Format("DeviceId = '{0}' AND Feederstatus <>'{1}'", … | |
Re: You can do in a loop: int x = 20, y = 20; //initial location x and y for(int i = 0; i < 2; i++) { Label l = new Label(); l.Position = new Point(x, y); l.Text = i == 0 ?" Text for label 1" : "Text for … | |
Re: Imports System.Web Dim encoded As var = HttpUtility.HtmlEncode(unencoded) | |
Re: 1. String is a type, that represents a string of Unicode characters. string is an alias for System.String in the .NET Framework. 2. String() is an array (more strings "together" can make an array of strings). 3. Spit my white spaces (" "c). 4. Reverse is a method of String … | |
Re: Dont your have some missmatch there? You want to have a sum from row 1 and cell 1 + row 1 an cell 2 = row 0 and cell 1 Isnt this a bit strange? Are you possitive this is it? -- I would use 1st column as JAN total, … | |
Re: Close this thread (if this is the thread you created). And create a new one. ![]() | |
Re: Add "ToString()" method on the end: comboBox1.SelectedItem.ToString(); To add: SelectedItem for it self is an object type, but I need to have a string. You could even Convert to string like: Convert.ToString(comboBox1.SelectedItem); | |
Re: Create a DataTable, do the SELECT statement of that number (column name) from database, and do the filtering, if the number already exists in dataTable. I would suggest using Linq - its simple and fast. It should be like: int textBoxNumber = int.Parse(textBox1.Text); DataTable table = new DataTable("Numbers"); using (SqlConnection … | |
Re: Hi, The main question is, are data in DGV bound to some collection (datatable for instance)? | |
Re: When populating DGV, do it with databinding from DataTable. So when changes to DGV will be made, all will reflect in datatable as well. Then do an Update sql query to update database. Check [here](http://support.microsoft.com/kb/307587) how it can be done. | |
Re: Hi, check here: http://www.java2s.com/Tutorial/CSharp/0600__Security/CreateaCryptoStreamusingtheMemoryStream.htm or: http://www.xtremedotnettalk.com/showthread.php?t=87696 | |
Re: One option would be to set accessor modifier of the dataSet to **public static**. Then you can access to dataSet simply ba Form name, like: class MyClass { public static DataSet myDataSet; } class MyOtherClass { void MyMethod() { DataSet ds2 = MyClass.myDataSet; } } Next option would be (not … |
The End.