1,469 Posted Topics

Member Avatar for 07-0466

Try to read a book, or more of them. [URL="http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=C%23+book&x=0&y=0"]Amazon.com[/URL] is a great place to start with.great place to start with. And while reading and going through example code, do your own examples in VS.

Member Avatar for 07-0466
0
117
Member Avatar for aadi_capri

[QUOTE=aadi_capri;1659446]... the problem which i am facing is, if the user redirects the form to another page and when comes back, i want that the previous choices clicked ba the user is visible to him when he browses back to the previous form.[/QUOTE] Does that means you close this form …

Member Avatar for aadi_capri
0
176
Member Avatar for twalton42

[QUOTE=twalton42;1649561]I have a form with multiple combo boxes and text boxes making an invoice.. I have the combo boxes linked to my database and I want each selection to fill a different textbox. The comboboxes fill on form load... How can I fill the textbox with the selected index from …

Member Avatar for lolafuertes
0
726
Member Avatar for Asotop

Or a bit more suphisitcated, using checking if char is number (and a bit different checking of binary data): [CODE] bool bExit = false; Console.WriteLine("Please type in a binary number: "); string binarynumber = Convert.ToString(Console.ReadLine()); while (!bExit) { foreach (char digit in binaryNumber) { if(char.IsDigit(digit) { int digit = Convert.ToInt32(new …

Member Avatar for arunkumars
0
194
Member Avatar for buggyboy100

This would be the best to use a generic list<T>, where T would be a custom class "AnimalData" for example. Add data to list (two of them), and then by using Linq get whats missing. Will it go?

Member Avatar for Mitja Bonca
0
140
Member Avatar for sidyusuf

Ok, here we go, I`d suggest you to add an aditional row (on top, at index ) to dataTable, like: [CODE] 'create table and bind it to comboBox: Dim table As New DataTable() table.Columns.Add("col1", GetType(String)) table.Rows.Add("item 1") table.Rows.Add("item 2") comboBox1.DataSource = table.DefaultView comboBox1.DisplayMember = "col1" 'now add an item to …

Member Avatar for Pgmer
0
337
Member Avatar for Shwetha Dali

Hi, try with this code: [CODE] private static void DrawABox( int x, int y, int width, int height,char Edge,string Message ) { int LastIndex =0 ; Console.SetCursorPosition(x, y); for ( int h_i = 0; h_i <= height ; h_i++ ) { if ( LastIndex != -1 ) { int seaindex …

Member Avatar for Shwetha Dali
0
1K
Member Avatar for SyncMaster170

Use Crystal Reports. You can create fields, and pass parameters to them (inside parameters there are your data). Check [URL="http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-tutorial.htm"]this website[/URL], and check all the links bellow.

Member Avatar for Mitja Bonca
0
104
Member Avatar for Chaitanya Dhote

Like: [CODE] role r = new role(); if(int.TryParse(Console.ReadLine(), out r.Role_id)) { Console.WriteLine("Id inserted."); } [/CODE] In case if you dont want to show the message, you can do: [CODE] role r = new role(); int.TryParse(Console.ReadLine(), out r.Role_id); [/CODE] but this way you would not know if value was inserted.

Member Avatar for Mitja Bonca
0
143
Member Avatar for anchamal

You can do it this way: [CODE] Dim date As DateTime = DateTime.Now If (date.DayOfWeek = DayOfWeek.Monday) Then MessageBox.Show("Your name is John.") ElseIf (date.DayOfWeek = DayOfWeek.Wednesday) Then MessageBox.Show("Your name is Tom.") End If [/CODE]

Member Avatar for adam_k
0
263
Member Avatar for rv1990

Plenty of them. The one gerard just mentioned is one of the greatest, which Iam currently reding. There are other too: - Illustrated C# 2008 (great for beginners) (or even 2010 version) - C# in Depth 2008 (and 2nd Edition) - C# 2008 (and 2010) Step by Step - C# …

Member Avatar for Kekke
0
132
Member Avatar for alinutzu

Try to set a database field, use a decimal and set 2nd number to number of decimal places: decimal(18,2) -> 2nd number is a number of numbers behind the decimal delimiter. NOTE: anyway if you leave all the decimals in the database, this doesnt change anything. When you retreive data …

Member Avatar for alinutzu
0
325
Member Avatar for muzhdah
Member Avatar for asd1234

Why you dont simply pass a reference of dataSet to Form2,and use it there as a dataSource of DGV2, the same as you did on form1 with DGV1? But with one Exception: Make DataSet accessible for all Form1 class Example: [CODE] //form1: DataSet q2; void PopulateDGV1() { OdbcCommand bcCom2 = …

Member Avatar for Mitja Bonca
0
125
Member Avatar for khentz

You can do it like this: [CODE] Dim dateOfExpiration As DateTime = DateTime.MinValue Dim sqlConn As SqlConnection = New SqlConnection("connString") Dim cmd As SqlCommand = New SqlCommand cmd.CommandText = "SELECT expirationDate FROM MyTable WHERE PhoneName = @name" cmd.Parameters.Add("@name", SqlDbType.VarChar, 50).Value = "yourPhoneName" cmd.Connection = sqlConn sqlConn.Open Dim reader As SqlDataReader …

Member Avatar for Mitja Bonca
0
83
Member Avatar for zifina

Try to use this code: [CODE] using System; using Microsoft.Win32; namespace MyApp { class Program { static void Main(string[] args) { RegistryKey adobe = Registry.LocalMachine.OpenSubKey("Software").OpenSubKey("Adobe"); if (adobe != null) { RegistryKey acroRead = adobe.OpenSubKey("Acrobat Reader"); if (acroRead != null) { string[] acroReadVersions = acroRead.GetSubKeyNames(); Console.WriteLine("The following version(s) of Acrobat Reader …

Member Avatar for zifina
0
1K
Member Avatar for zachattack05

Stop using region things, unless your code is really looong. Regions are only for your or someone elses notification to find some code faster, and its better organized as well. Usually we put fields, properties, delegates on top of the class (together in some order), below are methods and events. …

Member Avatar for zachattack05
0
138
Member Avatar for megabuild7

Hi, with all due respect, would you mind telling us the issue of this code? thx in advance.

Member Avatar for Mohammed Ammar
-2
217
Member Avatar for tapandesai007

Hmm, and where is a Timer reference? Times instantiation code? And why are 3 if blocks (same one) needed? You only create one. Take a look. Full code should look like: [CODE] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; //for this code bellow …

Member Avatar for tapandesai007
0
1K
Member Avatar for vasim jada

As Pgmer asked you, you will have to specify about what index is all about!?

Member Avatar for vasim jada
0
98
Member Avatar for lollqt

I dont know what exactly is this code for, but from your description I can tell you one thing: Amount2 IS NEVER EQUAL TO Amout1. Thats why it never leaves the while loop. [I]Double check why those two variables are never equal.[/I]

Member Avatar for Reverend Jim
0
391
Member Avatar for SyncMaster170

Hi, hmm, maybe whats wrong here is your select query, it should be like: [CODE] cmd.CommandText = @"SELECT date FROM WaynokaLogger WHERE AccountID = '" + newString + "'"; [/CODE] better would be using parametreized query: [CODE] cmd.CommandText = @"SELECT date FROM WaynokaLogger WHERE AccountID = @param1"; cmd.Parameters.Add("@param1", SqlDbType.VarChar, 50).Value …

Member Avatar for Mitja Bonca
0
105
Member Avatar for pseudorandom21

If you need data in run-time, then sure best option is to keep the data inisde classes, this is like you said using properties. If you want to store data for a longer run (when you close and re-open application), then its best to use xml or some files (ini, …

Member Avatar for Mohammed Ammar
0
134
Member Avatar for frost1

If I understand you, you want to get [B]20 different[/B] numbers (or what ever) using a Random class. If you will only use random.Next method, it possible of duplications too you know. Ok, next thing, you have to show all 20 numbers in the order they were inserted into an …

Member Avatar for Ketsuekiame
0
438
Member Avatar for SyncMaster170

Try something like this: [CODE] string first = "someFirstName"; string last = "someLastName"; DateTime CurentDate = new DateTime(2011, 10, 5); DateTime SearchingDate = DateTime.MinValue; using (SqlConnection sqlConn = new SqlConnection("connString")) { using (SqlCommand cmd = new SqlCommand()) { cmd.CommandText = "SELECT date FROM members WHERE name = firstname = @first …

Member Avatar for Mitja Bonca
0
132
Member Avatar for raaif

Yes, Jim is right, you cannot assign a variable (value) to a reference (when you create an instance of some class, this is called a reference to this created class instance). So, the closest you can get it to do like Jim showed.

Member Avatar for raaif
0
372
Member Avatar for SyncMaster170

Hm, you didnt say last time when I did this code for you, you will be using a new member insertion. If so, you have to do it a bit differently, you have to check if a user from the dataTable exists in DGV, and if not, then you can …

Member Avatar for SyncMaster170
0
110
Member Avatar for deefpi

[CODE] datagridview1.Rows.Add(); //add new row to dgv control int rowIndex = datagridview1.Rows.Count - 1; //get this row`s index //now insert one row from dataTable: //I will show you how to add 1st row from dataTable: int rowIndex = dataGridView1.Rows.Count - 1; for (int i = 0; i < table.Rows.Count; i++) …

Member Avatar for deefpi
0
445
Member Avatar for acepeda

Are these data which are shown in DGV binded from some data source, like dataTable?

Member Avatar for Netcode
0
82
Member Avatar for walid86

Can you show us some of your code? What type are those array lists? Of custom objects (classes) or some general type, lile string or integer? Anyway, put then into one collection, and then do a loop through this collection. And try to find what you are looking for. [CODE] …

Member Avatar for walid86
0
170
Member Avatar for sujit.patil

Hi, check [URL="http://stackoverflow.com/questions/2832783/compare-two-dlls"]here[/URL] for the answer.

Member Avatar for Mitja Bonca
0
78
Member Avatar for acepeda

Best and simpliest approach is to fill the DataTable from the dataBase data, and use dataSource property of dataGridView to bind data to it. Like:[CODE] Dim table As New DataTable() Using sqlConn As New SqlConnection("connString") Using da As New SqlDataAdapter("SELECT Column1, Column2 FROM MyTable", sqlConn) 'you can add a WHERE …

Member Avatar for Mitja Bonca
0
151
Member Avatar for moshe12007

You have to pass the DataTable from form where button1 is located (form1 or whatever) to EditData class: [CODE] DataTable table; private void FillDataTable() { table = new DataTable(); //fill it here... } private void button1_Click(object sender, EventArgs e) { EditData ed = new EditData(); ed.TryIt(table); //pass data as argument …

Member Avatar for moshe12007
0
139
Member Avatar for madhan

Since your data is seperated by a delimiter (comma), you can do an array of data. Then each index of an array will be holding each seperated data like address1, address2, city,.. This way will be faster and easier to sepetate. So you can do: [CODE] string[] dataArray = myOutput.Split(','); …

Member Avatar for Mitja Bonca
0
128
Member Avatar for Srcee
Member Avatar for Mitja Bonca
0
2K
Member Avatar for alinutzu

Sure you can. Simply create new DGVcomboBox column and add or insert it to dgv columns. [CODE] DataGridViewComboBoxColumn cmbcolumn = new DataGridViewComboBoxColumn(); { cmbcolumn.Name = "cmbColumn"; cmbcolumn.HeaderText = "combobox column"; cmbcolumn.Items.AddRange(new string[] { "aa", "ac", "aacc" }); //items in comboBox } dataGridView1.Columns.Insert(1, cmbcolumn); //inserting comboBox into 2nd columns (colimn at …

Member Avatar for riteshbest
0
175
Member Avatar for iefilec

Hi, please check [URL="http://www.techonthenet.com/sql/like.php"]here[/URL] how to use Like condition. Its all well explained. bye

Member Avatar for Mitja Bonca
0
262
Member Avatar for rotten69

The same error: Incorrect syntax near '.'?? Please double check the correctness of table names and fields.

Member Avatar for arunkumars
0
205
Member Avatar for casey_sunako

Hi, this [URL="http://www.codeproject.com/Questions/163016/How-to-embed-VLC-control-in-c-net-windows-applicat"]link[/URL] might help you out.

Member Avatar for casey_sunako
0
213
Member Avatar for sidyusuf

You can do it this way: [CODE] Private Sub button1_Click(sender As Object, e As EventArgs) Dim couter As Integer = 1 For i As Integer = 0 To dataGridView1.Rows.Count - 1 If Not dataGridView1.Rows(i).IsNewRow Then dataGridView1("rollNo", i).Value = [String].Format("{0}-{1}", "11", System.Math.Max(System.Threading.Interlocked.Increment(couter),couter - 1).ToString().PadLeft(4, "0"C)) End If Next End Sub [/CODE] …

Member Avatar for sidyusuf
0
243
Member Avatar for Ruchi224
Member Avatar for Raja Pandiyan

You have to know that dataTable by default has object type. No string ot integer. So if you want to pass some integer value, you have to explicitly (or implicitly) convert it.

Member Avatar for peter_budo
0
297
Member Avatar for techlawsam

Yes, you should name methods so they have a common sence. And every one can understands them. The best approach is to name them in this kind of manner, that someone who reads it, even approximatelly knows what is inside the method (the code it self). Rename this method (GetInches) …

Member Avatar for Mitja Bonca
0
364
Member Avatar for adem87

if you set the variable as type of string, it cannot change, because string is immutable (that means it cannot be changed ones its been created). For sure somewhere in your code you create a new string for this variable. Double Check your code.

Member Avatar for NetJunkie
0
136
Member Avatar for gaurav_gandhi13

There is plenty of books out there. Look on [URL="http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=C%23+book&x=0&y=0"]amazon.com[/URL] I would recommend you to get books: - Illustrated C# 2008 (for beginners) - C# 4.0 in a Nutshell (great books, has all) - just read it About the coding, if you have any particular example code, where you are …

Member Avatar for gaurav_gandhi13
0
218
Member Avatar for SyncMaster170
Member Avatar for virusisfound

The code looks fine, the only problem is, that the ID should not be let to be insterted by the user (from textBox). It has to be created some how automatically, so starting from 1,2,3, and so on (each new id is +1, incrementally). I would suggest you to get …

Member Avatar for virusisfound
0
189
Member Avatar for gaurav_gandhi13

You have to use DataBinding. Get the data you want to show in textBoxes in the dataTable, then set data binding for each textBox and use "CurrencyManager". [URL="http://www.akadia.com/services/dotnet_databinding.html"]Here[/URL] is a great example, its all there. Take your time to study all whats there on this website. cya

Member Avatar for Mitja Bonca
0
4K
Member Avatar for kylelendo

[QUOTE=thines01;1656240]For the password, you should use ExecuteDataReader()[/QUOTE] ExecuteSclalar is appropriate here too, because it returns a single value. But its not appropriate to return the password, because you dont actually use it any where, password should only (meant) be to check if the user is the right one, or not. …

Member Avatar for kylelendo
0
332
Member Avatar for asfakhusainm

If you want to get data from one table of the database to a dataTable, and populate a comboBox with the data from one of the columns of the dataTable, then you can do: [CODE] DataTable table = new DataTable(); // get the members (new ones) using (SqlConnection sqlConn = …

Member Avatar for Mitja Bonca
-1
62

The End.