1,469 Posted Topics
Re: I would like to know how you file looks like (phisiclly). Then tell us what to add, change, or what ever... | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: >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.. … | |
Re: 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 | |
Re: 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 / … | |
Re: And [here](http://www.csharphelp.com/2006/03/c-operator-overloading/). | |
Re: 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? | |
Re: Use DISTINCT keyword inside you sql query statement (since you said these data come from database). | |
Re: Put a pictureBox on the form, and put gif animation inside of it. | |
Re: 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 … | |
Re: This means the select query did not return any row. There is no data in the table regarding the condition (in where clause). | |
Re: I dont see any code of comboBox, only textbox | |
Re: [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? | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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; … | |
Re: 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). | |
Re: 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 … | |
Re: 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? | |
Re: 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]; … | |
Re: 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"; … | |
Re: 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, … | |
Re: 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 … | |
Re: Or you can use a StreamReader class and ReadLine() method, and count +1 on each step if line contains your requirement. | |
Re: 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? | |
Re: type this like of code into form load: this.FormBorderStyle = FormBorderStyle.FixedSingle; | |
Re: What type is the column **DatePrinted** in your database? Is it a real datetime, or its just a varchar? You dont do any parsing. | |
Re: 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,...) … | |
Re: >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 … | |
Re: 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? | |
Re: 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 … | |
Re: Try something like: string command = "mailto:test@test.com?subject=Test Subject&body=Line 1%0D%0ALine 2"; Process.Start(command); | |
Re: 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). | |
Re: 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 … | |
Re: 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). | |
Re: 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); … | |
Re: or: TimeSpan ts = DateTime1.Subtract(DateTime2); //date1 is newer then date2 | |
Re: 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 | |
Re: **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); … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 = … | |
Re: 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). | |
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 … | |
Re: 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 … | |
Re: 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='" + … |
The End.