1,469 Posted Topics
Re: [QUOTE=chandnigandhi;1638344]... with the help of mouse by clicking on button line should be displayed on panel and if first rectangle should not b disappeared...[/QUOTE] Hi, I don`t understand these words. Can you please elablrate it better? Thx in advance. | |
Re: So you wanna have n numbers of listboxes - depending how many subfolder you go into. Isnt this a bit strange? It would make sence to show on 1st listbox folders and in 2nd listBox files in this folder (if you are on root - C:, D: then show files … | |
Re: The best way would be to use a dictionary collection. Key will be an actual number, and Value it`s repetition. | |
Re: Create a new UserControl, and "put" ListView inside of it. Position the userControl to the position you want (based on the cell (right) mouse click I think). | |
Re: You can set tje order of the columns like: [CODE] dataGridView1.Columns["Name"].DisplayIndex = 0; dataGridView1.Columns["RegNo"].DisplayIndex = 1; dataGridView1.Columns["Adress"].DisplayIndex = 2; [/CODE] | |
Re: What do you mean by refresh? Is you mean that the controls are automatially filled up with the appropriate data (based on some selection), then you need to bind each control. You can use DataSource property (for ie. dgv, comboBox, listBox, and set DisplayMember (and ValueMember if needed)) and DataBinding … | |
| |
Re: To get a week number of the month you can do: [CODE] //in your method: DateTime time = DateTime.Now; int weekNumber = GetWeekOfMonth(time); //calling a method public static int GetWeekOfMonth(DateTime date) { DateTime beginningOfMonth = new DateTime(date.Year, date.Month, 1); while (date.Date.AddDays(1).DayOfWeek != CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek) date = date.AddDays(1); return (int)Math.Truncate((double)date.Subtract(beginningOfMonth).TotalDays / 7f) … | |
Re: You said that dataset is a dataSource of dgv, right? Why dont you look in the dataSet? Check here for solution: - [url]http://msdn.microsoft.com/en-us/library/Aa325591[/url] - [url]http://msdn.microsoft.com/en-us/library/det4aw50.aspx[/url] | |
Re: Hi, you want to update what? Database or datagridview? This code looks like more to be use to update database, just that UPDATE statement isnt sufficient enough). Is has to be like: "UPDATE TableName SET Field1 = @field1, Field2 = @field2 WHERE ColditionColumn = @field3" Am I right? | |
Re: - Illustratec C# 2008 (for beginners) - C# in depth 2nd Edition - C# 2008 (or 2010) Step by Step) - C# 4.0 In a Nutshell but there is plenty of books, especially on amazon.com Depends what you would like to lean. Or OOP, or databases, of web prgramming, or.. | |
Re: They sure (those two variable members; row_count, columnCount) do not exist in the scope. How does the compiper go through? Where do you instanitate these two varibles? For sure not in the code you pasted up here. What they represent and which values they should have? Please double check where … | |
Re: I dount. I dont think so. But if this is only the look you want do have (so from 2 forms will be look like 1), you can do the following: - put all the controls on each form intoa userControl (together with the code of course) - create a … | |
Re: Here is what you can do: I would use a backgroundworker, and do the download work in it: [CODE] private delegate void DownloadDelegate(string msg); private BackgroundWorker bgv; public Form1() { InitializeComponent(); //create bgv: bgv = new BackgroundWorker(); bgv.ProgressChanged += new ProgressChangedEventHandler(bgv_ProgressChanged); bgv.DoWork += new DoWorkEventHandler(bgv_DoWork); bgv.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgv_RunWorkerCompleted); //label … | |
Re: do it: [CODE] using System; namespace hahahahahahahahaha { class Program { public static void Main(string[] args) { constructor1 obj = new constructor1(); Console.ReadLine(); //need to insert this line of code to show console! } } public class constructor1 { public constructor1(); { Console.WriteLine("hahahaha"); } } } [/CODE] | |
Re: Why would you do an even for some button inside other button? This makes no sence. Events for all the button can be generated on the load time. Or when you create some button in the run time (afterwards). If you still inisit you can do it: [CODE] private void … | |
Re: You have to add rows as well (every loop): [CODE] int clicks = 0; private void button4_Click(object sender, EventArgs e) { dataGridView1.Rows.Add(); dataGridView1.Rows[clicks].Cells["Author_Number"].Value = "Author " + (clicks + 1).ToString(); dataGridView1.Rows[clicks].Cells["First_name"].Value = "fname"; dataGridView1.Rows[clicks].Cells["Last_name"].Value = "lname"; clicks++; } [/CODE] | |
Re: Hi, have you managed to salve the problem yet? | |
Re: Would you mind showing us the code? I cannot know what can be wrong. | |
Re: Try to change it to: [CODE] con.ConnectionString = strconnection If con.State = ConnectionState.Closed Then con.Open() End If Dim str As String = "Select CUSTOMERID from tbl_Customer" cmd = New SqlCommand(str, objconnection) Dim dr As SqlDataReader = cmd.Executereader() While (dr.Read()) 'If the id column is not integer, chnage "int" with correct … | |
Re: DateTime column is causing the problems I would say. YOu only do "DateTime.Now" - no parsing to string. btw, what error you get in catch Exception? | |
Re: I have showed you an example in some other of your thread!! | |
Re: There is no private class and any sign of any property in your example. Private class does not exist at all (it cannnot). Do you know what properties are? And what classes are for? | |
Re: Try with this: [CODE] bool bMaleSelected; public Form1() { InitializeComponent(); textBox1.Text = "9164"; comboBox1.Items.AddRange(new string[] { "male", "female" }); comboBox1.SelectedIndexChanged += new EventHandler(comboBox1_SelectedIndexChanged); } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.SelectedIndex > -1) { int intValue = 0; if (int.TryParse(textBox1.Text.Trim(), out intValue)) { if (comboBox1.SelectedItem.ToString() == "male") { … | |
Re: AS Momerath stated, its an awkward example. But you can use a base keyword to access members of the base class from within a derived class: [CODE] class Program { static void Main(string[] args) { Son p1 = new Son(); Father p2 = (Father)p1; Father p3 = new Father(); p1.print(); … | |
Re: About which details are you talking about? There is nothing like it. | |
Re: You can specify some date, like today (but you have to be aware that Today property does not set any day time, it is actually, but it sets to 00:00:00 "hh:mm:ss"), so then you can add 7 days to this date, and check if this date is a new date: … | |
Re: Do you add object to array list like that: [CODE] ArrayList main = new ArrayList(); main.Add("1,A"); main.Add("2,A"); main.Add("3,B"); [/CODE] | |
Re: Placing the files in the solution folder won't do anything, you have to tell the solution to add new project/files. Chose File->Add Project-[color=blue] >Existing Project and then browse to your individual project files (.csproj[/color] files). You can also right click your solution name and Add->Existing Items to add individual files … | |
Re: Why would you do a for loop? I dont see any reasonable reson why use it. Please explain why would you use a for loop? | |
Re: [URL="http://www.developerfusion.com/tools/convert/vb-to-csharp/"]Here[/URL] you have online converter. | |
Re: Instead of while loop, better use abn if block. Because you want to go through the code only ones. And there you can put an else block, which will be fired if no data will be found: [CODE] If dr.Read Then txtidno.Text = dr("ID_No") txtname.Text = dr("Borrower_Name") cbocourse.Text = dr("Course") … | |
Re: Maybe this way?: [CODE]System.Diagnostics.Process myprocess = System.Diagnostics.Process.Start("notepad.exe"); [/CODE] | |
Re: You have to create columns of listView to dataTable (with a bit of a List<T> help), then loop through the listView to fill dataTable: [CODE] 'lets assume we have 3 column in listView!! 'get columns: Dim listOfColumns As New List(Of String)() For Each column As ColumnHeader In listView1.Columns listOfColumns.Add(column.ToString()) Next … | |
Re: Hi, sorry, but I dont really understand what you are saying. Would you please do a bit better explanation to the problem you are facing? thx in advance. | |
Re: [QUOTE=saqi1986;1544804]Any IDea how to Parse a String without using Split method[/QUOTE] What do you means exactly? Because there is pleanty of ways of "modifing" a string - all he string methods. | |
Re: Do you want to show this data in the previous form? | |
Re: If I understood you, you want to load a picture into a pictureBox? And the right one? Does the image has a name? | |
Re: Can you describe the problem a bit better, and what is it that you want?! But as far as I understood, you get some data from DB: [I]ID=1 Reccurence = "Monthly" DuePatten = "26"[/I] Now based on this you want to create an array of dates, am I right? What … | |
Re: Dont complicate things. Do it like this: [CODE] Dim conn As New SqlConnection("connString") Dim da As New SqlDataAdapter() Dim table As New DataTable() da.SelectCommand.CommandText = "your select query" da.SelectCommand.Connection = conn da.Fill(table) [/CODE] And you dont have to use DataSet,if you only have one DataTable. Instead you use DataTable, as … | |
Re: [QUOTE=mukadam.bilal;1619277] If a label enters another label.[/QUOTE] What do you mean exactly? | |
Re: Not true, it wont help. This is what you can try: [CODE] da.Fill(ds,"myTable"); dgv1.DataSource = new BindingSource(ds.Tables["myTable"], null); //but the same as using names is using table indexes, like you did! [/CODE] | |
Re: [CODE]mysqlda.UpdateCommand.Parameters.Add("@Price", MySqlDbType.Decimal ,10,2, "Price");[/CODE] The 3rd parameter in the Add() method is the [I]Size[/I], and its must me an integer. So no commas in between. You dont specify and such thing as in the database, where you specify the number of decimals (like 10, 2 - 10 numbers lenght,and precision … | |
Re: Use this pattern to all: [CODE] Dim a As Decimal = 6.25D //pattern: Dim fraction As Decimal = a - CInt(Math.Truncate(a)) a = a - fraction + (0.95D) [/CODE] | |
Re: Show us full code.. the connection instantiation, and its connection string. | |
Re: alt + w (in european keyboards) | |
Re: or: [CODE]Dim letters As Char() = textBox1.Text.ToCharArray()[/CODE] | |
Re: Hi, check for solution [URL="http://forums.asp.net/t/1441971.aspx/1?How+can+i+convert+my+datatable+into+XML+using+C+2+0+"]here[/URL]. | |
Re: Do you have any custom class for all this object? If would be good to have it. At least you can show us the code you have, and what would you like to change (comment it). |
The End.