1,469 Posted Topics

Member Avatar for sujit.patil

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 …

Member Avatar for Ketsuekiame
0
2K
Member Avatar for tendaimare

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() …

Member Avatar for safrans
0
3K
Member Avatar for WolfShield

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.

Member Avatar for Momerath
0
1K
Member Avatar for cumadhu

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 …

Member Avatar for Michael27
0
549
Member Avatar for eoop.org

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.

Member Avatar for Randlathor05
0
172
Member Avatar for Mitja Bonca

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 …

Member Avatar for Mitja Bonca
0
218
Member Avatar for navachaitanya

[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?

Member Avatar for Mike Askew
0
222
Member Avatar for ingus16

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(" ")) …

Member Avatar for ingus16
0
7K
Member Avatar for Mitja Bonca

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 …

Member Avatar for waqassilat
0
854
Member Avatar for kytro360

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());

Member Avatar for kytro360
0
235
Member Avatar for cheekangteh

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 …

Member Avatar for Mitja Bonca
-1
227
Member Avatar for mitesh.24jain

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?

Member Avatar for mitesh.24jain
0
212
Member Avatar for mzeewashooo

This code: if(RadioButton1.Checked) { Form2 f2 = new Form2(); f2.Show(); } else if (RadioButton2.Checked) { // do something else }

Member Avatar for Mitja Bonca
0
199
Member Avatar for chris283

Use int.Parse() method: if (int.Parse(row.Cells[3].Value.ToString()) >= -1) { //do work... }

Member Avatar for Mitja Bonca
0
112
Member Avatar for jnbradl

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.

Member Avatar for Mitja Bonca
0
227
Member Avatar for ScubaSam

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 …

Member Avatar for ScubaSam
0
94
Member Avatar for lakshmi dorai

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 …

Member Avatar for Mitja Bonca
0
110
Member Avatar for morgan.wowk

Have you set column names? And I would suggest you to set View to Details, not to List or any other type.

Member Avatar for Mitja Bonca
0
285
Member Avatar for Cronicle8

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

Member Avatar for Kousha
0
1K
Member Avatar for Acidburn

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

Member Avatar for Mitja Bonca
0
125
Member Avatar for saqi1986

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 …

Member Avatar for klklklk
0
1K
Member Avatar for jarid.lawson
Member Avatar for nthabiJacq
Member Avatar for ckchaudhary

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.

Member Avatar for ckchaudhary
0
415
Member Avatar for muhammad ismail

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.

Member Avatar for Mitja Bonca
0
290
Member Avatar for robin99

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).

Member Avatar for Mitja Bonca
0
106
Member Avatar for saybabs

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.

Member Avatar for Cameronsmith63
0
403
Member Avatar for Rimmi90

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.

Member Avatar for Mitja Bonca
0
246
Member Avatar for king03

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.

Member Avatar for peter_budo
0
4K
Member Avatar for daksein

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 …

Member Avatar for daksein
0
116
Member Avatar for daringone

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 …

Member Avatar for Michael27
0
220
Member Avatar for HibaPro

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)

Member Avatar for HibaPro
0
177
Member Avatar for mikeoabban

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.

Member Avatar for macgurl70
0
139
Member Avatar for valestrom

Or I would use sb.AppendLine(line); This will put lines into each line (same as in file).

Member Avatar for Mitja Bonca
0
211
Member Avatar for hafizurahman

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 …

Member Avatar for Reverend Jim
0
828
Member Avatar for hasan101002

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

Member Avatar for hasan101002
0
104
Member Avatar for kim_boto

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 { …

Member Avatar for kim_boto
0
174
Member Avatar for nikki05
Member Avatar for arunkumars

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}'", …

Member Avatar for Mitja Bonca
0
1K
Member Avatar for da10x

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 …

Member Avatar for da10x
0
172
Member Avatar for ulasoc
Member Avatar for ulasoc
0
205
Member Avatar for Mathspy

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 …

Member Avatar for Mathspy
0
159
Member Avatar for Mikey12345

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, …

Member Avatar for Reverend Jim
0
169
Member Avatar for Ajayraj
Member Avatar for GilbertB

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);

Member Avatar for Mitja Bonca
0
243
Member Avatar for GilbertB

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 …

Member Avatar for bharat_4g
0
809
Member Avatar for GilbertB

Hi, The main question is, are data in DGV bound to some collection (datatable for instance)?

Member Avatar for Mitja Bonca
0
174
Member Avatar for SHaseeb

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.

Member Avatar for SHaseeb
0
464
Member Avatar for auwi987

Hi, check here: http://www.java2s.com/Tutorial/CSharp/0600__Security/CreateaCryptoStreamusingtheMemoryStream.htm or: http://www.xtremedotnettalk.com/showthread.php?t=87696

Member Avatar for Mitja Bonca
0
120
Member Avatar for markyjj

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 …

Member Avatar for Mitja Bonca
0
1K

The End.