1,469 Posted Topics

Member Avatar for charqus

Ok, lets define, you have Form1 and Form2. Form1 is Main Form, Form2 is Info. Which one you call in Program.cs (Application.Run(XXXX)); - xxxx is from1 or form2? This is how you should have: in application.Run method you have to call Form1 (so the main form, not the intro). Before …

Member Avatar for Mitja Bonca
0
120
Member Avatar for GaBack

If you mean that you have a file on a hdd, and you want to read out from it, then like this: [CODE] private static void ExerciseMethod() { System.Collections.ArrayList list = new System.Collections.ArrayList(); using (System.IO.StreamReader sr = new System.IO.StreamReader(@"C:\1\FileExample.txt")) { string line = null; while ((line = sr.ReadLine()) != null) …

Member Avatar for Mitja Bonca
0
121
Member Avatar for DaveTran
Member Avatar for Mitja Bonca
0
87
Member Avatar for UsSy

Here is the code. Take a closer look, and please use a break point to go through all the code - and then let me know if there is anything to add. [CODE] 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 …

Member Avatar for Mitja Bonca
0
157
Member Avatar for jlivvers

I did some code for you. I have even put the numericUpDown control on the form to select numbe of weeks randomly. And to select the beginning of calculation, you choose if from dateTimePicker. This is the code: [CODE] public partial class Form1 : Form { public Form1() { InitializeComponent(); …

Member Avatar for jlivvers
0
126
Member Avatar for Purushottamkr

I did an example of sorting number, and I used a generic list. I copied your values from decimal array to list<decimal> and did what you have requested. I hope you like it. Its fast and simple - and it works :) [CODE]private void method() { decimal[] arr = new …

Member Avatar for Diamonddrake
0
1K
Member Avatar for darkelflemurian

Did you attach the db into your project? You attach the db to your project when selecting new databse (Tab- Data-> Add new DataSource) On the 2nd page you got a question: Would you like to copy the file to your prouject and modify the connection? You have to choose …

Member Avatar for Mitja Bonca
0
178
Member Avatar for NewOrder

In this code simpleArray[i, m] == simpleArray[1, 2] there is no array of [1, 2]! but I dont even know what are you trying to do. maybe would help, if you explain us your code a bit better. Mitja

Member Avatar for croker10
0
138
Member Avatar for Klaurac

What are we talking here? Or DataBase or DataTable? This is no way you will insert data to dataBase. For inserting data into database, you need on open sql connection and created sql command, which will insert data. Didn`t you confuse it witl dataTable (or dataSet)?

Member Avatar for Klaurac
0
268
Member Avatar for metalstorm

[url]http://efreedom.com/Question/1-1013294/Send-Files-Tcp-TcpListener-Client-SocketException-Problem[/url]

Member Avatar for Diamonddrake
0
312
Member Avatar for mscutie33

You can not asign a method ReadLine as the parameter of the WriteLine method. You can do as follows: [CODE] while (!MyReader.EndOfStream) { string Mystring = MyReader.ReadLine(); // reads data into an array & outputs data to console int[] myArray = Mystring.Split(' '); //split value by some marks(white spalce, comma, …

Member Avatar for mscutie33
0
2K
Member Avatar for stevetaylor15

This is the code which populates the textBox with only wanted items (the ones which dont have the name infront of sing @): [CODE] private void PopulatingListView() { string[] array = new string[] { "[email protected]", "@test.com", "@contoso.com" }; for (int i = 0; i < array.Length; i++) { string value …

Member Avatar for stevetaylor15
0
7K
Member Avatar for Shlesh

Here is a code: [CODE] class Class1 { public static Class1 cs; public static int s = 0, m = 0; /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { // // TODO: Add code to start application here // int[,] a = …

Member Avatar for ashishkumar008
0
141
Member Avatar for Ringlis1983

I did a simple example of how populate and remove items (selected items) from comboBox and listBox: [CODE] 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 Nov23TextCombo { public partial class Form1 : Form { // //ADD LISTBOX AND COMBOBOX ON …

Member Avatar for Mitja Bonca
0
128
Member Avatar for Riekus007

This will do the trick: Just for into: number 1 in the square brackets represents 2dn column in dgv. [CODE] private void GetValueFromDGVToTextBox() { int row = this.dataGridView1.CurrentCell.RowIndex; if (row > -1) { string value = this.dataGridView1[1, row].FormattedValue.ToString(); textBox1.Text = value; } } [/CODE]

Member Avatar for Mitja Bonca
0
102
Member Avatar for trippinz

Can you be please a bit more splecific. What exactly do you need. And the code above you`ve posted, its not in any help - it has nothing to do with your question. So please concentrate on what you need, and if you want some help from us, please, explain …

Member Avatar for crishjeny
0
167
Member Avatar for DioRani

If you have a dataBase in your project, you sure have a file called App.Config. You will find it in Solution explorer. There you have a connection string written, and also the name of the connection string. This is en example: [CODE] <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> </configSections> <connectionStrings> …

Member Avatar for crishjeny
0
126
Member Avatar for TheDocterd

I have done some homework for you, and this is the code I came up with. There is still some work to be done with selecting folder, now you have to write paths, but this is not the thread of this thread. Mainly the app works like you wanted to …

Member Avatar for crishjeny
0
117
Member Avatar for herbkanis

1st, about you the error "column Price" doesn not belong to table: YOu have to create columns before filling the table up. YOu do it like: [CODE] DataTable table = new DataTable("TableName"); table.Columns.Add(new DataColumn("Price", typeof(decimal))); //specify the correct value type table.Columns.Add(new DataColumn("Name", typeof(string))); //then you can fill it up... ;[/CODE] …

Member Avatar for crishjeny
0
393
Member Avatar for muzikhera

But this is not a slolution he is looking for. He uses a DataBase, not a file. I`ll try to do the code for you. Wait a bit... EDIT: I would like to know which data type are column login and logout? Are type of DataTime? Or something else? Its …

Member Avatar for muzikhera
0
155
Member Avatar for "ICode"

Maybe its the problem in using the substitution to your database -> |DataDirectory|. |DataDirectory| (enclosed in pipe symbols) is a substitution string that indicates the path to the database. It eliminates the need to hard-code the full path which leads to several problems as the full path to the database …

Member Avatar for Momerath
0
931
Member Avatar for Jesi523

I checked and repair it. This should work now. BTW: you dont need to create new instances of connectionString and sqlConnection. You can set this only ones (just make sure thats it opened, when its needs to be - but only one, ok?). Here is the code: [CODE] private void …

Member Avatar for Mitja Bonca
0
88
Member Avatar for amr_asd5

Or you can use delegates, which will call some method on form where you have radioButton, which will be checked before form from where is it called, will close.

Member Avatar for Mitja Bonca
0
106
Member Avatar for hurkagurk

What do you have on the forms you would like to change (shrink or grow)? Controls? Which one? I this the only way to accomplish what you want is , that on every scroll of the mouse, you would have to recalculate and reposition all the controls (all the stuff) …

Member Avatar for Mitja Bonca
2
133
Member Avatar for mahdi68

SMS is not for free. This will not do. There are ways but you will have to pay the service. Are you still intereseted?

Member Avatar for Mitja Bonca
0
902
Member Avatar for Shlesh

Read here: [url]http://aspalliance.com/1227_Understanding_Operator_Overloading_in_C.all[/url] its all well explained.

Member Avatar for Mitja Bonca
0
75
Member Avatar for akklmx

Write the string as follows: [CODE] private static OleDbCommand DbConnect(OleDbCommand mDB) { mDB.ConnectionString = @"Provider = Microsoft.Jet.OLEDB.4.0; Data source= C:\Database\winbase.mdb"; return mDB; } This should work! [/CODE]

Member Avatar for Mitja Bonca
0
830
Member Avatar for lelejau

This is the solution, and you do not need to use any threads. This will only complicate things (simples you dont need to use them). This is the simple example of how to pass data (parameters) over forms and being showed: [CODE] //FORM 1: public partial class Form1 : Form …

Member Avatar for Mitja Bonca
0
184
Member Avatar for Shlesh

Take a look at here: [url]http://www.c-sharpcorner.com/uploadfile/mahesh/cmdlineargs03212006232449pm/cmdlineargs.aspx[/url] and: [url]http://csharp.net-informations.com/overview/csharp-commandline-arguments.htm[/url] Some good info.

Member Avatar for ashishkumar008
0
206
Member Avatar for ktimov1

No, if you want to update view, you will have to re-populate dgv. You can do it on 2 ways: 1. create dataTable and bind it to the dataSource of dgv 2. crete dataTable and populate dgv manually (column by column, row by row) The best way of populating dgv …

Member Avatar for Mitja Bonca
0
577
Member Avatar for gokulprema

This is the simpleast and easiest way to get the data from DB to dgv: [CODE] private void Form1_Load(object sender, System.EventArgs e) { // Bind the DataGridView to the BindingSource // and load the data from the database. dataGridView1.DataSource = bindingSource1; GetData("select * from Customers"); } private void GetData(string selectCommand) …

Member Avatar for Mitja Bonca
0
163
Member Avatar for nssltd

If upper posts dont help, check here for solutions: [url]http://stackoverflow.com/questions/2887924/invalid-uri-the-format-of-the-uri-could-not-be-determined[/url]

Member Avatar for Mitja Bonca
0
140
Member Avatar for Wattsits

You populate listView on clicking on a button, if I understand you well. So no need to use a listView even to do something with the data from it. Simply create another method for calculations which will be called just after listView population, and it will look something like it: …

Member Avatar for Mitja Bonca
0
173
Member Avatar for Wattsits

Yep, this is how to be done. You have create a new instance of a class ListViewItem. And when ever you want to add subitems to it, you have to call the newly created instance of a class and then called it`s subitem class to add some value into a …

Member Avatar for Wattsits
0
121
Member Avatar for tangosixfour

You would like to insert some data to Database, from DataSet, am i correct? Can i see the code which creates and populates the dataSet?

Member Avatar for Mitja Bonca
0
107
Member Avatar for jlivvers

Maybe this can help you out: [URL="http://msdn.microsoft.com/en-us/library/system.data.datatable.primarykey.aspx"]http://msdn.microsoft.com/en-us/library/system.data.datatable.primarykey.aspx[/URL]

Member Avatar for Mitja Bonca
0
173
Member Avatar for Wattsits

I changed a bit your code, but I dont know what "[B]ReadCode[/B]" on line 26 from the code bellow, would be. So I couldnt test it: [CODE] static void Main(string[] args) { ArrayList list = new ArrayList(); list.Add("Test1"); list.Add("Test2"); Bitmap bmp = new Bitmap(@"C:\myTestPic.jpg", true); int numScans = 2; FullScanPageCode39(list, …

Member Avatar for Wattsits
0
122
Member Avatar for CharlieHolt

If I understand you, you would like to remember the X,Y position of the windows form. So when the form is re-opened, it has to appear on the same spot as it was last time, righ? If so, here is an exmaple how to get the points and insert them …

Member Avatar for CharlieHolt
0
147
Member Avatar for choover12

I will show you a sime example of to split array. Here you go: //this is a button1_Click method, or could be even anything else: [CODE] string value = textBox1.Text; if(value.Lenght > 0) { string[] array = value.Split(' '); //split by whitespace string rows = null; int i = 0; …

Member Avatar for kvprajapati
0
326
Member Avatar for DaveTran

DaveTran: I really dont understand what can be wrong with your original loop. How long is the "batchVerticles object? it is less then 3? I dont know what you have "optimized" it in the way you did - thats not optimization. Its de-optimization. Can you please explain bit better, why …

Member Avatar for Momerath
0
142
Member Avatar for drake10k

The code that I will post now, its one hell of a code. I just did it for my 1st time. And its works perfectly. I took me an hours to do it all. I did as you wanted. On pre-installed button, the code created new buttons (one under another …

Member Avatar for drake10k
0
163
Member Avatar for jlovesfishiee

This code has got to do, what you have asked in the 1st post of the thread: [CODE] public partial class Form1 : Form { bool bJump; public Form1() { InitializeComponent(); } private void textBox1_TextChanged(object sender, EventArgs e) { if (!bJump) { int intValue = 0; string strValue = textBox1.Text; …

Member Avatar for Mitja Bonca
0
390
Member Avatar for arvin.gh

Here you have an example of how to upload an image to a database. And btw, you dont need to savew the file path to a database table (its useless): [url]http://www.aspfree.com/c/a/ASP.NET/Uploading-Images-to-a-Database--C---Part-I/[/url] [url]http://www.daniweb.com/forums/thread273361.html[/url]

Member Avatar for Mitja Bonca
0
145
Member Avatar for arvin.gh

1st of all, why do you use button DoubleClick event? Why not only Click? 2nd of all, I dont understand you what exactly is going on (wrong). So can you please upload some of the code, which you suspect has the issue? thx Mitja

Member Avatar for Mitja Bonca
0
171
Member Avatar for CharlieHolt

[url]http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/032eabc3-ee2d-467e-9240-4b86f7f58472[/url]

Member Avatar for Mitja Bonca
0
146
Member Avatar for procomp65

This has nothing to do with cache. Always when you do a login, you have to check for the user`s userName and password. And if the database is empty (that means that the userName and passowrd do not exist in the database), user cannot log in. As simpe as that. …

Member Avatar for procomp65
0
113
Member Avatar for "ICode"

If you want to send SMS from PC, this will not be free. You will have to pay for it. It was free a few years back, but not its payable stuff. Anyway, here you can find some help: [url]http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/3b5a4fc8-b8f0-4663-b7fd-b04f0a3e4bd3[/url] [url]http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/278219a1-20e8-4d25-a2ed-eafbe7ef0bb1[/url] I was creating a software which was used to …

Member Avatar for "ICode"
0
128
Member Avatar for sharkpit

This is how you can access the varialbes (or accessors) on the other classes and pass data into them: [CODE] namespace Nov22Sample { class Program { static void Main(string[] args) { MyClass1 class1 = new MyClass1(); class1.SendingMessage(); } } class MyClass1 { public void SendingMessage() { string str1 = "This …

Member Avatar for Mitja Bonca
0
125
Member Avatar for Jarrhed

Here is a simple example of how to populate listView. I have put all together into one method, but its better to put the column creations into form load (so it loads only one time). This is the code: [CODE] private void PopulatingListView() { this.listView1.Items.Clear(); this.listView1.Columns.Add("1st column", 75, HorizontalAlignment.Left); this.listView1.Columns.Add("2nd …

Member Avatar for Mitja Bonca
0
5K
Member Avatar for vinayak.v

Which software do you use for coding? If this is Visual Studio and programming language C# or VB, I would suggest you to use Crystal Reports. I have tried them all, and the one I mentioned is simple the best (in my opinion) - offers the most and its quite …

Member Avatar for Mitja Bonca
0
144

The End.