1,469 Posted Topics
Re: You forgot to add: **Is your comboBox databound?** | |
Re: We need more info. Is your comboBox bound to some datasource? | |
Re: Try out this code: TextBox[] tbs; public Form1() { InitializeComponent(); tbs = new TextBox[2] { textBox1, textBox2 }; //create same event for both textboxes for (int i = 0; i < tbs.Length; i++) { tbs[i].KeyDown += new KeyEventHandler(TextBoxes_KeyDown); } } private void TextBoxes_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == … | |
Re: Sure, change if loops with while. | |
Re: What type of the object "bRDATABindingSource1"? Next, why would you filter by daytime? You mean to filter for specific time of a day (of this same day)? Or to want to filter ony by time (no matter of days)? It would be smart idea to hav all data in datatable, … | |
Re: Oxiegen showed how to write an sql query statement. Is that what you are looking for? Iam asking because you said "tables", they might be dataTables, then we need a different approach, best to use Linq and Lambda Expression (in case if you got all the data from database to … | |
Re: Hmm, here is much work to be done. You are really messing things. This code does not even complie. To do your simple program, you can do: class Program { static void Main(string[] args) { string filePath = @"C:\YourFolder\testFile.txt"; StreamReader sr = new Streamreader(filePath); string line = ""; for (int … | |
Re: You cannot simply MOVE data from table to table. You can do it by regular steps: 1. SELECT value1, value2,... FROM tableName (if you want all: SELECT * FROM...) 2. INSERT INTO tableName VALUES (value1, value2,...) This is how you can do it. | |
Re: 1st of all, why do you pass a RichTextBox referene as argument (into this method)? If you do this code in the class (form) where contorl is, you can access to it directly. Otherwise, your method must return this same reference to form where control really is! So method must … | |
Re: For using MonthCalendar control and when you want to go 1 month forward and backward when pressing buttons: Private Sub button1_Click(sender As Object, e As EventArgs) '1 month forward Dim [date] As DateTime = monthCalendar1.SelectionStart monthCalendar1.SelectionStart = [date].AddMonths(1) monthCalendar1.SelectionEnd = monthCalendar1.SelectionStart End Sub Private Sub button2_Click(sender As Object, e As … | |
Re: Exactly, when you rename the form1, you got a messageBox, where is asking you if you want to rename all references connected with project, and if you choose yes, Even Designer will rename!! Try it out, you will see it works,. bye | |
Re: And how is this sorted? I dont see any sortig there on that image. Its only somekind of a table with numbers inisde - which start from the middle box and they go out? -- If I understand you, you have an array of numbers, from 1 to 36, and … | |
Re: I would change your code completely. I would run login before form1 initialization. If login is successful, then open form1, and pass the argument to it (argument from login form to form1 as parameter): static class Program { [STAThread] static void Main() { using (Login login = new Login()) { … | |
Re: Sorry, but we are here to help, nothing else. If you wont show any effort, we cannot show it too. And if you are a bit of a programmer, you can easily do something, it seems a easy task (if at least you know something about coding). So, whats it … | |
Re: You can create a custom form (call it when right click). Search google how to make custom chapes of forms. [Here](http://www.codeproject.com/Articles/8056/Creating-Custom-Shaped-Windows-Forms-in-NET) is an exampe. Put some buttons on it (or some other controls) which will be made for choosing options. | |
Re: Maybe you dont insert into the right database. If you use this connection string: "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\myworkers.mdf;Integrated Security=True;User Instance=True"; And using "|DataDirectory| inside of it, this means you are inserting into database, that is attached into your project. And you will not see any changes made. SOLUTION: Specify the full path … | |
Re: Check this code: [CODE] public Form1() { InitializeComponent(); listBox1.Items.AddRange(new string[] { "a", "b", "c" }); listBox2.Items.AddRange(new string[] { "a", "c", "d", "e" }); } private void button1_Click(object sender, EventArgs e) { List<string> list1 = new List<string>(); List<string> list2=new List<string>(); foreach (string item in listBox1.Items) list1.Add(item); foreach (string item in listBox2.Items) … | |
Re: Is Discount same for all items (for all the rows in gridview)? This is an important question so code knows what to update - or a sinlge row or all the rows. | |
Re: [QUOTE=dilse4sk;1773834] to restrict the user so that he/she cannot enter the date in the past. [/QUOTE] I have another preposition: do now allow user to write date. Use MonthCalendar to select the date, and do not show the date older then you want (or today`s date or what ever). Can … | |
Re: This is the code you need: For Each row As DataGridViewRow In dataGridView1.Rows Dim timeOut As Object = dataGridView1("Timeout", row.Index).Value Dim timeIn As Object = dataGridView1("Timein", row.Index).Value If timeOut Is Nothing Then dataGridView1.Rows(row.Index).DefaultCellStyle.BackColor = Color.Red ElseIf timeOut IsNot Nothing AndAlso timeIn IsNot Nothing Then dataGridView1.Rows(row.Index).DefaultCellStyle.BackColor = Color.Green End If Next … | |
Re: Hmm... What DOES your application? So it can run in the backgorund? --- You know, there is no difference if the app is minimized or not, if it has work to do, it will do it. No matter in what kind of visual state it is. So, what does your … | |
Re: your prorgram? How can be your program, if you actually have nothing? :) Please, tell us a bit more what exactly do you want. You know, we are here to help, not doing code instead of you guys. So, if you will not out some effort, at least giving us … | |
Re: Still hard to tell, since he didnt tell us what exactly he expects from the query. | |
Re: What about this way: privat void MyMethod() { List<string> results = ReadingFiles(@"C:\MyFolder", "*.txt"); } private List<string> ReadingFiles(string dirPath, string exstension) { List<string> filesContent = new List<string>(); StringBuilder sb; DirectoryInfo di = new DirectoryInfo(dirPath); FileInfo[] files = di.GetFiles(exstension, SearchOption.TopDirectoryOnly); foreach (FileInfo file in files) { using (FileStream fs = new FileStream(file.FullName, … | |
Re: Where can we get foreign keys of Member_id, and Album_id? And we even have to get primary key of th table (Trnsaction_id), how do we get it? One option is to create a method, that looks for last inserted id, and we only increment it by 1, so we get … | |
Re: > I know how to create textbox dynamically but the problem now is that I want it below my previous created textbox I really dont get what you would like to do. Please re-define it. thx | |
Re: >error appering by: >.ExecuteNonQuery() >t says this: >ncorrect syntax near the keyword 'unique'. unique is a column name in your database. maybe he only gave you an example name, you have to change it to your actaul column name! | |
Re: Put the values from the row into Body tag of MailMessage class. What you can do it to loop through the rows of dgv, and concat data from each row and send mail. To do a loop you can do: For Each row As DataGridViewRow In datagridview1.Rows 'mail to send … | |
Re: Code is setting some variable "nurl" based on some matching - which is done by using [Regular Expressions](http://www.regular-expressions.info/dotnet.html). After that (in 2nd if statement) is checks the "nurl" varialbe and get some string from readPage() method. Next (and last), is fires ExtractResults() method which obviously does some things (like setting … | |
Re: I would advice to use textBoxes, because you (or user) will work with one item (product) at a time. Can I ask you where do you have stored the information about product, i mean how much is one unit? Do you have a class like "ProductInfo", where you have properties: … | |
Re: do: Private rtb1 As RichTextBox Private Sub button1_Click(sender As Object, e As EventArgs) rtb1 = New RichTextBox() rtb1.Name = "rtb1" rtb1.Size = New Size(300, 200) 'set it rtb1.Location = New Point(20, 20) 'set it Me.Controls.Add(rtb1) End Sub | |
Re: Memorath, how would you do that what you said? Would like to see that too. | |
| |
Re: How your code can know which are "new" data? Cant know at all. What you can do, is to insert on the end of some text like END OF DATA", so when you will insert new data, you will read from "END OF DATA" on. This is my simple example, … | |
| |
Re: You can put a class into **using** statement, this way it will Dispose() automatically when exiting the loop. | |
Re: You want to hide.... ok! When do you want to show it up again? --- You could createa class boolean flag, and with it determine when to hide it for n clicks (1,2,..n), or when to hide it forever. | |
Re: You are using what? Access or sql? These are 2 difference concepts. You can use varchar (string). | |
Re: I would do it differenty. I would run Login form before starting the main form (with application.Run). Take a look at here: static class Program { [STAThread] static void Main() { using (Login login = new Login()) { login.StartPosition = FormStartPosition.CenterScreen; if (login.ShowDialog() == DialogResult.OK) { Application.Run(new Form1(login.strUserName)); //passing the … | |
Re: Exactly what darkagn said. Variable "data" is null. Your dataTable do not get fill up. Check like he expalined. The method "DataTable data = App.getGenericData(sqlString);" does not return anything. Check that method. | |
Re: What do you have to validate in dateTimepicker control? There is always a datetime selected (and shown). There cannot occur any error. Explain what do you want to validate. If you will use Value property of selected date, you will always get certain and real datetime value. | |
Re: Use DataView class and RowFilter property of it, to specify the filter. But before that fill the dataTable and use databinding (datatable has to be a binding source of datagridview control). You can find an example [URL="http://msdn.microsoft.com/en-us/library/system.data.dataview.rowfilter.aspx"]here[/URL]. bye | |
Re: When you call Dispose() method on some object, it means it is completey shuted down (you can understand it to be more then Closed - while closed object you can still access to it with its reference). So Disposed objects are like then is no reference to them (not exisitng … | |
Re: No, variable ONLY holds one value. So the last passed to it. If you "overwrite" false with true, there is no way to get false back. Only true is available. | |
Re: You went to right direction saleem, but you should only use DataGridViewRow class. Why? You cannot select more then 1 row, since you only have 1 textBox for each column (so array of rows drops off here). You can do: [CODE] Dim row As DataGridViewRow = dataGridView1.SelectedRows(0) txtHotelId.Text = row.Cells(0).Value.ToString() … | |
Re: Try do use StreamReader class to read the file line by line, and count repetitions of char: [CODE] Dim counter As Integer = 0 Using sr As New StreamReader("filePath") Dim line As String Dim data As String() = Nothing While (InlineAssignHelper(line, sr.ReadLine())) IsNot Nothing If line.Contains("*"C) Then data = line.Split(New … | |
Re: No, but its MSSQL -this is Microft database, but its Express editon, that means its capacity is limited to 2GB (in VS 2010 the limit it 4GB). | |
Re: Your main problem was you only specify 3 value to be updates, then you add 4 parameters! Next: What exact data type are the columns in the data table? My assumption: - pic id - integer - pic - image (you must pass a byte array to db) - caption … | |
Re: Check the list [URL="http://www.microsoft.com/learning/en/us/certification/view-by-name.aspx"]here[/URL]. | |
Re: or do a loop through all the textboxes and clear them (or what ever you want to do with them): [CODE] For Each t As TextBox In Me.Controls.OfType(Of TextBox)() t.Text = String.Empty Next [/CODE] |
The End.