1,469 Posted Topics

Member Avatar for kampao00
Member Avatar for jhedonghae
Member Avatar for nicewave

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 == …

Member Avatar for jbrock31
0
121
Member Avatar for kampao00
Member Avatar for shah1509

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, …

Member Avatar for Mitja Bonca
0
619
Member Avatar for reds8

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 …

Member Avatar for poojavb
0
157
Member Avatar for masterinex

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 …

Member Avatar for Momerath
0
257
Member Avatar for zo0oda

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.

Member Avatar for adam_k
0
1K
Member Avatar for Kappash

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 …

Member Avatar for Kappash
0
82
Member Avatar for Sevyt

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 …

Member Avatar for Sevyt
0
98
Member Avatar for nicewave

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

Member Avatar for Mitja Bonca
0
86
Member Avatar for Michael27

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 …

Member Avatar for Mitja Bonca
0
354
Member Avatar for rick.eavans

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()) { …

Member Avatar for Mitja Bonca
0
843
Member Avatar for sam ferns

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 …

Member Avatar for Mitja Bonca
0
86
Member Avatar for irffan

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.

Member Avatar for Mitja Bonca
0
143
Member Avatar for outout1234

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 …

Member Avatar for Mitja Bonca
0
231
Member Avatar for Behseini

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) …

Member Avatar for mtns
0
2K
Member Avatar for nirmal.k.2

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.

Member Avatar for nirmal.k.2
0
185
Member Avatar for dilse4sk

[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 …

Member Avatar for dilse4sk
0
277
Member Avatar for Mike Bishop

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 …

Member Avatar for Mike Bishop
0
120
Member Avatar for roshan_shetty

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 …

Member Avatar for anuj6928
0
95
Member Avatar for praveenrko

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 …

Member Avatar for Mitja Bonca
0
365
Member Avatar for Farhan_B

Still hard to tell, since he didnt tell us what exactly he expects from the query.

Member Avatar for M.Waqas Aslam
0
208
Member Avatar for omeja

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, …

Member Avatar for Mitja Bonca
0
139
Member Avatar for darthswift00

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 …

Member Avatar for darthswift00
0
294
Member Avatar for networkmancer

> 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

Member Avatar for Reverend Jim
0
1K
Member Avatar for darthswift00

>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!

Member Avatar for darthswift00
0
142
Member Avatar for dilse4sk

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 …

Member Avatar for dilse4sk
0
2K
Member Avatar for tendaishava

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 …

Member Avatar for thines01
0
234
Member Avatar for dilse4sk

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: …

Member Avatar for P.manidas
0
971
Member Avatar for Gus_19

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

Member Avatar for Mitja Bonca
0
257
Member Avatar for priyanka85

Memorath, how would you do that what you said? Would like to see that too.

Member Avatar for skatamatic
0
207
Member Avatar for vidyade
Member Avatar for Mitja Bonca
0
68
Member Avatar for NavVet

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, …

Member Avatar for Mitja Bonca
0
270
Member Avatar for bosz015
Member Avatar for Mitja Bonca
0
90
Member Avatar for senbaris

You can put a class into **using** statement, this way it will Dispose() automatically when exiting the loop.

Member Avatar for Mitja Bonca
0
226
Member Avatar for poojavb

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.

Member Avatar for Mitja Bonca
0
247
Member Avatar for er_svijayakumar

You are using what? Access or sql? These are 2 difference concepts. You can use varchar (string).

Member Avatar for adam_k
0
136
Member Avatar for nicewave

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 …

Member Avatar for Mitja Bonca
0
87
Member Avatar for carinlynchin

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.

Member Avatar for Mitja Bonca
0
144
Member Avatar for huskarit

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.

Member Avatar for laxmanpathare
0
1K
Member Avatar for saleem.mukhtiar

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

Member Avatar for adam_k
0
98
Member Avatar for Andy90

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 …

Member Avatar for Andy90
0
187
Member Avatar for zachattack05

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.

Member Avatar for zachattack05
0
143
Member Avatar for saleem.mukhtiar

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() …

Member Avatar for saleem.mukhtiar
0
205
Member Avatar for poojavb

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 …

Member Avatar for Mitja Bonca
0
198
Member Avatar for mnewsome

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).

Member Avatar for Mitja Bonca
0
110
Member Avatar for kevinyu

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 …

Member Avatar for Mitja Bonca
0
280
Member Avatar for Sravanthi Ch

Check the list [URL="http://www.microsoft.com/learning/en/us/certification/view-by-name.aspx"]here[/URL].

Member Avatar for Mitja Bonca
0
77
Member Avatar for Sevyt

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]

Member Avatar for Mitja Bonca
0
97

The End.