1,469 Posted Topics

Member Avatar for Dendari

I would like to know how you file looks like (phisiclly). Then tell us what to add, change, or what ever...

Member Avatar for Dendari
0
205
Member Avatar for sicko

Maybe there is a lot of columns? There is nothing special about your code, maybe there is really a lot of data. Try creating a new thread, and put this code to run on it, you UI will be free to run.

Member Avatar for Mitja Bonca
0
125
Member Avatar for chuyauchi

I would suggest you to create a new class name it "Student", add some properties like Firstname, lastname and gpa. Create a genertic list<T> where T will be class name: List<Student> listOfStudents = new List<Student>(); Now loop through the rows on the text file, on each row split data (by …

Member Avatar for Mitja Bonca
0
149
Member Avatar for IKhan123

Would you mind showing us your code? Another question, ar eyou using database, or excel file? Because sheets are in excel file, not in database.

Member Avatar for Mitja Bonca
0
53
Member Avatar for jhedonghae

>i have 2 combobox, one is for the start time and the other is for the end time. my problem is on how to set the time interval.. for example if user select 6:00am as start time and 6:00 am as end time it must prompt that is in invalid.. …

Member Avatar for Sahil89
0
696
Member Avatar for Freedom*

Create a class like "User", and create properties like Username, and Password. Then create a generic list<t>, where T will be your class name. Create two classes like: User u1 = new User(); u1.USerName = "name1"; u1.Password = "pass1"; //same do for user2 and then compatre them

Member Avatar for Mitja Bonca
0
79
Member Avatar for Asotop

I would suggest you to split into array rather then adding a whitespace (you can still add a whitespace when you have an array); static void Main(string[] args) { string iPAddress = "11111111111100000000000001111111"; string[] ipSeperated = SplitString(iPAddress, 8); } static string[] SplitString(string str, int size) { return Enumerable.Range(0, str.Length / …

Member Avatar for Mitja Bonca
0
146
Member Avatar for T0pAz
Member Avatar for Mitja Bonca
0
90
Member Avatar for sing1006

What do you mean by: >... but if i want to Refer to the others Instance of an Object? Can you show a simple code example?

Member Avatar for Reverend Jim
0
101
Member Avatar for ZainabJuma
Member Avatar for jhedonghae

Use DISTINCT keyword inside you sql query statement (since you said these data come from database).

Member Avatar for jhedonghae
0
111
Member Avatar for ZainabJuma
Member Avatar for murnesty

You could use [Polymorphism](http://msdn.microsoft.com/en-us/library/ms173152(v=vs.80).aspx) in your project. This means you will use your Database class as your base class, and other 2 (Conversation and Display) classes will be deirived from it - this means they both can access to base class. But this still wont salve the problem of having …

Member Avatar for Mitja Bonca
0
127
Member Avatar for kspecks

This means the select query did not return any row. There is no data in the table regarding the condition (in where clause).

Member Avatar for kspecks
0
104
Member Avatar for paoi00
Member Avatar for Donnovan

[Here](http://www.regular-expressions.info/dotnet.html) you can find plenty of info about using Regular expressions. Can you tell us more about this issue?

Member Avatar for thines01
0
129
Member Avatar for jhedonghae

Change the password inside the connection string (as Jx said already). And where is username? Usually there are both, username and password in the connection string.

Member Avatar for jhedonghae
0
471
Member Avatar for erikdeboy

I would suggest you to create a new class called "Employee", with properties: id, experiances, Salary. Then create a generic list<T>, where T is this class name. Create new Employee on each new row read, and fill properties with data from file. Example: //custom class: class Employee { public string …

Member Avatar for thines01
0
794
Member Avatar for paoi00

Hmm, can you be a bit more specific where this error occurs? Please use break point, and then go through the code line by line, so you will exactly see where it happens. Just something (and I hope the error is here), about UPDATE query, you dont use and WHERE …

Member Avatar for paoi00
0
197
Member Avatar for paoi00

You have to calculate 2 things: 1. the dimensions of the form 2. the dimensions of the control (listView in your case) Then calculate to position it in the middle. So you can do: int formX = this.Width; int formY = this.Heigth; int listX = listView1.Width int listY = listView1.Heigth; …

Member Avatar for paoi00
0
90
Member Avatar for Begginnerdev

try it this way: string date1 = "1/2/2001"; DateTime date = Convert.ToDateTime(date1); //this is what you have to do: string date2 = date.ToString("MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture); My 1st two lines of code are only example to get an actual date (you already have a date from database).

Member Avatar for Begginnerdev
0
161
Member Avatar for newbie12345

When you open form2, you only have to pass variable to constructor of form, and pas it to some control, which will show the value (ie. username): ~~~ vb 'on form1: Public Property YourUserName() As String Get Return m_YourUserName End Get Private Set m_YourUserName = Value End Set End Property …

Member Avatar for smitty68503
0
5K
Member Avatar for paoi00

What is it ComboBox1.Text written? So you want to do inseetion on each enrollment? And when this number goes over 60 pop up a message?

Member Avatar for paoi00
0
90
Member Avatar for kram54

Try this: DataTable table2 = new DataTable(); table2.Columns.Add("Column_name", typeof(string)); table2.Columns.Add("Row_name", typeof(string)); DataRow row; int counter = 0; for(int i = 0; i < tableOriginal.Columns.Count; i++) //loop through the columns of original table { for(int j = 0; j < tableOriginal.Rows.Count; j++) { if(j == 0) { table2.Rows.Add(); table2.Rows[counter][0] = tableOriginal.Rows[j][i]; …

Member Avatar for Mitja Bonca
0
220
Member Avatar for Farhad.idrees

Check this out: PLEASE: take time and study the example. Code works, you only have to adapt to your needs. [CODE] public partial class Form1 : Form { bool bSkipping; DataTable table; public Form1() { InitializeComponent(); string[] semesters = { "1st", "2nd", "3rd" }; comboBox1.DataSource = semesters; comboBox1.DisplayMember = "Value"; …

Member Avatar for robea
0
153
Member Avatar for Aviplo

You can do it this way: Call this method: Private Sub InsertingIntoDB() Dim fileName As String = "D:\PPOS\Sales_report\inventory_255503221452_Cake102.csv" Using conn As New SqlConnection("connString") Dim query As String = "INSERT INTO inventory (Inventory_id, item_id, Amount, AvgCost, CreateDate, CreateUser, Real_Qty, UnitID, BranchID) " & "VALUES(@a, @b, @c, @d, @e, @f, @g, @h, …

Member Avatar for ExpertMind
0
3K
Member Avatar for jhedonghae

1st, why use use Validating event? Why not SelectedIndexChnaged (of comboBox(es))? 2nd, change comboBoxX.Text with comboBoxX.SelectedItem.tostring() 3rd, remove "if(rid.HasRows)" out of the code, change it with "if(rid.Read())" statement and last,: You cannot use comboBox3.Text, this will do nothing. What you can do, is to ADD a new Item to this …

Member Avatar for jhedonghae
0
131
Member Avatar for mxadam

Or you can use a StreamReader class and ReadLine() method, and count +1 on each step if line contains your requirement.

Member Avatar for Mitja Bonca
0
197
Member Avatar for TriaL11

One you say listBox, and ones listView? What is it gonna be? > but when I dont type anything, the listview items gone.., What is thill suppose to mean?

Member Avatar for poojavb
0
245
Member Avatar for nicewave

type this like of code into form load: this.FormBorderStyle = FormBorderStyle.FixedSingle;

Member Avatar for Mitja Bonca
0
80
Member Avatar for paoi00

What type is the column **DatePrinted** in your database? Is it a real datetime, or its just a varchar? You dont do any parsing.

Member Avatar for paoi00
0
206
Member Avatar for dsmoore

You didnt tell us a thing concering your issue. You only pasted some code and some error. Please, tell us more about it. Where this error occurs, and so on? You have plenty of variables inside this code, that we dont even know what they really are (ie: transaction, Variables,...) …

Member Avatar for dsmoore
0
222
Member Avatar for agilocha

>QUOTED FROM poojavb: >Enter the correct cell no and then on the click of the row in datagrid view u will get the cell value in the text >box >textbox1.Text = DGS4.CurrentRow.Cells(0).Value Do not forget to use ToString() method on the end, else will be a compile time error: textbox1.Text …

Member Avatar for poojavb
0
199
Member Avatar for RenanLazarotto

What will you have in a listbox? Files? If so you can do a loop through all the item in listbox and compare each of them to your file name. Can you do it?

Member Avatar for RenanLazarotto
0
101
Member Avatar for apals

No problem if there is a not of rows of code. Sometimes there is no other way. If calculating a sum of some column, you have to do a loop through all the rows to get a value in each row and do the sum. What exactly would you like …

Member Avatar for Mitja Bonca
0
219
Member Avatar for zachattack05

Try something like: string command = "mailto:test@test.com?subject=Test Subject&body=Line 1%0D%0ALine 2"; Process.Start(command);

Member Avatar for Mitja Bonca
0
152
Member Avatar for kytro360

What do you mean delay? Create a new thread, put some timer on it, and show update some control like label to notify a user ther is something going on (ie: wait: seconds) by using delgate for updating a control (from another treead to ui thread).

Member Avatar for Mitja Bonca
0
296
Member Avatar for castajiz_2

This is some strange code to find min and max value of integer array. Why dont you create an array of n numbers, and then use Linq to find those 2 values: //an array of numbers: int[] numbers = { 1, 2, 3, 4, 5 }; //then do: int min …

Member Avatar for castajiz_2
0
852
Member Avatar for ShadyTyrant

What do you mean with Imports? And this is some strange question. For this, you better turn directly on Microft developers (who created this application, and if your proposal would be the one to consider, Im sure they will listen you).

Member Avatar for thines01
0
134
Member Avatar for Rahmania03

If you wanna put into edit mode a cell that equals the comboBox selected item, then you can do: private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Cells[0].Value.ToString() == comboBox1.SelectedItem.ToString()) //0 is for 1st column { DataGridViewCell cell = row.Cells[0]; dataGridView1.CurrentCell = cell; dataGridView1.BeginEdit(true); …

Member Avatar for Rahmania03
0
496
Member Avatar for de Source
Member Avatar for darko444
0
497
Member Avatar for kampao00

Check the other thread of yours, I have answered you there. And close this one, we will continue discussion in one thread only. Ok? thx in advance, bye

Member Avatar for Mitja Bonca
0
196
Member Avatar for venkateshyeluri

**Are you sure you have the right connection string? ** And if there are data inside details table? If so you can try this code: MySqlConnection myconn = new MySqlConnection("server=localhost;user id=root;password=db;database=workers;"); string strSQL = @"SELECT * FROM details"; MySqlDataAdapter mydata = new MySqlDataAdapter(strSQL, myconn); DataTable table = new DataTable("myTable"); mydata.Fill(table); …

Member Avatar for venkateshyeluri
0
193
Member Avatar for R.K.3

This for sure is a a school project (isnt it)? So, do you have created any code? Show us how it really looks this Array. Anyway, indexes must have numbers (not must, there always is a number, because array[T] means array as number T has some value), othwewise this is …

Member Avatar for R.K.3
0
535
Member Avatar for kampao00

If there are multiple columns i datatable, you have to use Subitems to fill listView (item in only 1st column in listview, else are subitems). So you should do: Dim lvi As ListViewItem For Each myrow__1 As DataRow In dt.Rows lvi = New ListViewItem() lvi.Text = mRyow(5).ToString() lvi.SubItems.Add(myRow(6).ToString()) '6 is …

Member Avatar for Oxiegen
0
163
Member Avatar for Zvjezdan23

YOu create a new instacne of array on each stop while going through for loop. This is sure something you dont want to. Do as skaa said: Console.Write("How many people are there in your room? "); x = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(" "); string[] names_ = new string[x]; for (int i = …

Member Avatar for thines01
0
94
Member Avatar for kiail

Try using liqn with lambd a expressions: var query = descQuantity.Where(w=>w.Price => 250 && w.Price <= 550).Select(s => new Invoice { Id = s.Id, Name = s.Name, Quantity = s.Quantity }).ToList(); I dont know you actaul properties of the Invoice class, so rename them (inside brackets).

Member Avatar for kiail
0
538
Member Avatar for Mitja Bonca

I am doing a crystal report, and I would like to dinamiclly add parameters. I did the code which adds the value to one parameter, which I have created in the crystalReportViewer: [CODE]CrystalReport1 cr = new CrystalReport1(); cr.SetParameterValue("ParameterName", ParameterValue); crystalReportViewer1.ReportSource = cr; crystalReportViewer1.Refresh(); [/CODE] But this is for only one …

Member Avatar for darko444
0
3K
Member Avatar for raheel88

So many data into a text file? Is this a smart way to do it? How will you then know what is what? You can use flags like some special characters that the code can recognize them as NOT-TEXT, but like: this is from button1, this is from datagridview, and …

Member Avatar for raheel88
0
184
Member Avatar for darthswift00

Try creating DataTable and fill it with data, if there wil be no rows inside of it, return false, if there are rows, return true: Private Function CheckingData() As Boolean Dim con As New System.Data.SqlClient.SqlConnection("Data Source=CHETS-TOSHIBA\SQLEXPRESS;Initial Catalog=PlanetDiscLibrary;Integrated Security=True") Dim sqls As String = "Select * from album where album_id='" + …

Member Avatar for poojavb
0
129

The End.