1,469 Posted Topics
Re: 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 … | |
Re: 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) … | |
Re: Just dont forget to mark the thread as salved if you are satisfied with the answer :) bye | |
Re: 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 … | |
Re: 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(); … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 | |
Re: 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)? | |
Re: [url]http://efreedom.com/Question/1-1013294/Send-Files-Tcp-TcpListener-Client-SocketException-Problem[/url] | |
Re: 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, … | |
Re: 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[] { "one@test.com", "@test.com", "@contoso.com" }; for (int i = 0; i < array.Length; i++) { string value … | |
Re: 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 = … | |
Re: 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 … | |
Re: 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] | |
Re: 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 … | |
Re: 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> … | |
Re: 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 … | |
Re: 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] … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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) … | |
Re: SMS is not for free. This will not do. There are ways but you will have to pay the service. Are you still intereseted? | |
Re: Read here: [url]http://aspalliance.com/1227_Understanding_Operator_Overloading_in_C.all[/url] its all well explained. | |
Re: 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] | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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) … | |
![]() | Re: 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] |
Re: 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: … | |
Re: 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 … | |
Re: 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? | |
Re: 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] | |
Re: 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, … | |
Re: 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 … | |
Re: 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; … | |
Re: 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 … | |
Re: 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 … | |
Re: 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; … | |
Re: 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] | |
Re: 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 | |
Re: [url]http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/032eabc3-ee2d-467e-9240-4b86f7f58472[/url] | |
Re: 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. … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … |
The End.