1,469 Posted Topics
Re: I will agree with Momerath, but if you still insist with depliying sql server into application, then you can read [URL="http://msdn.microsoft.com/en-us/library/aa983326.aspx"]here[/URL] for more info. | |
Re: Set both properties SelectionStart to zero and SelectionLength to the lenght of the text inside: [CODE]textBox1.SelectionStart = 0 textBox2.SelectionLength = textBox1.Text.Lenght[/CODE] | |
Re: Go here: [URL="http://converter.telerik.com/"]http://converter.telerik.com/[/URL] [URL="http://www.developerfusion.com/tools/convert/vb-to-csharp/"]http://www.developerfusion.com/tools/convert/vb-to-csharp/[/URL] | |
Re: Check it [URL="http://social.msdn.microsoft.com/forums/en-US/Vsexpressvcs/thread/6fb71753-8ac5-44c5-80fa-733b7258d2ca/"]here[/URL]. | |
Re: [QUOTE=aksay;1771226]i am working on a project for booking management system for photographers.. can anyone suggest some tables and content for the project....![/QUOTE] Booking man. system for photographers? What could that be? How can we help you, if you dont know how to start? This is you and only you here … | |
Re: Did you set the column to be type of Image in the 1st place? | |
Re: Rather create a List<T> where T is a class object (student name, ...) | |
Re: 1. Tell me one thing, how do you populate these 2 listBoxes? Because so far I havent seen this code (and you actually didnt tell us). 2. And tell me one more thing, when some item is selected in listbox1, when you wanna transfer to listbox2, On which index do … | |
Re: You would like to get only the rows of customers that have the written lastname in textBox, if I got you right? This means you have to do the filtering over dataSet to get new DataRows (array of them) and them convert this array back to dataset to bind it … | |
Re: I really suggest you to read any/some book(s) mate. It would really do good for you. You are constantly asking basic questions, that you should know it easily, if you are coding for at least a couple of months. No offence, but this is how it is. We are here … | |
Re: try: [CODE] If listBox2.Items.Contains(listBox1.SelectedItem.ToString) Then MessageBox.Show("This item is in listbox 2.") End If [/CODE] | |
Re: School stuff, right? We should not suppose to do the code instead of you, you know. You do have some code, so what parts you do NOT understand, from what you have to do from your 1st task? And please, do not post more then ONE issue at a time. | |
Re: You can use SqlDataReader and set value to it: [CODE] SqlConnection conn = new SqlConnection("connString"); string query = @"SELECT SUM(columnName) FROM MyTable"; SqlCommand cmd = new SqlCommand(query, conn); SqlDataReader reader = cmd.ExecuteReader(); if(reader.Read()) textBox1.Text = reader[0].ToString(); reader.Dispose(); cmd.Dispose(); conn.Dispose(); [/CODE] | |
Re: try like: [CODE]"update po_detail set po_number= '" & txtPoNo.Text & "' where po_number = 0"[/CODE] or if your database column is type of integer: [CODE]"update po_detail set po_number= '" & Integer.Parse(txtPoNo.Text) & "' where po_number = 0" [/CODE] | |
Re: is your listbox databound? do you use DisplayMember and Valuemember properties? If you DO NOT, you can NOT get SelectedValue property. | |
Re: [QUOTE=ng5;1770587]I have a listbox and would like to save the items...[/QUOTE] Save them where? To a database, to excel, to text file,..? | |
Re: Good question Momerath, but I doubt, otherwise, he wouldnt ask us. Its quite some code, if you want it to make it up for you. Tell us what you know already, so you make it easier for us. | |
Re: Get the current process and set its priority. [CODE] System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.Low;[/CODE] | |
Re: Maybe your "Department_Code" is not a varchar type in the dataTable. If its an integer you have to convert the textBox text property to a number (int.Parse, or Convert.Toint32() methods). Otherwise code looks clean. Or define parameters a bit differently: [CODE]parameters.Add("@field2", SqlDbType.VarChar, 50).Value = txt_user.Text[/CODE] | |
Re: Make your "str" variable as static. [CODE] static string str = ConfigurationManager.ConnectionStrings["Bank"].ConnectionString; SqlConnection con = new SqlConnection(str); [/CODE] | |
Re: Hmm, we would need a BETTER explanation of the problem here. Why would you use switch inside a switch? Makes no sence to me...yet! | |
Re: Maybe it would be better if you would use Parameters, and pass these variables inside of your query to them. Example: [CODE] tCom.CommandText = "(SELECT ID, Timestamp FROM jobdata WHERE Timestamp >= @param1 ..."; tCom.Parameters.Add("@param1", SqlDbType.DateTime).Value = dCurTimeStart - dTolerance; //.. [/CODE] This is only an exmaple, you add all … | |
Re: or use string.format method: [CODE] private void DoCalculation(int min, int max) { List<int> listOfEvenNumbers = new List<int>(); for(int i = min; i <= max; i++) { if(i % 2 == 0) listOfEventNumbers.Add(i); } StringBuilder sb = new StringBuilder(); foreach(int number in listOfEvenNumbers) sb.Addend(number.ToString() + ", "); MessageBox.Show(String.Format("The result is:\r\n- Even … | |
Re: I think you would need some better issue explanation... what kind of buttons and labels are you talking about? Ones you want to itterate through buttons, next time you talk only about label? Whats it gonna be? Please try a bit better. | |
Re: You cannot have the same label, but you can use the same variable. The value in this variable will be shown in label on form1 and in label of form2. [CODE] 'form1: Class Form1 Private f2 As Form2 Public Sub New() InitializeComponent() End Sub Private Sub GetData() Dim decValue As … | |
Re: This should be like this: [CODE] Textbox[] tbs; //creating buttons: private void button1_Click(object sender, EventArgs e) { int total = 0; if(int.TryParse(textBox1.Text, out total) { tbs = new TextBox[total]; int x = 20; //x location int y = 20; //y location for(int i = 0; i < tbs.Lenght; i++) { … | |
Re: Simply do: [CODE] class Event { private string myListofAthletes = "N/A"; public string ListofAthletes { get { return myListofAthletes; } set { myListofAthletes = value; } } } class Program { private static void Main() { Event[] ListofAthletesArray = new Event[50]; Console.WriteLine("Enter List of Athletes participating in Event 1:"); for(int … | |
Re: If you want to check for a white space in runtime then you have to use KeyPress event handler: [CODE] private void textBox1_KeyPress(object sender, KeyPressEventArgs) { if(char.IsWhiteSpace(e.KeyChar)) { MessageBox.Show("Space key has beed pressed!"); } } [/CODE] | |
Re: You can use databiding from List<T> to listBox, and then check if items are in lists while looping through listBox: [CODE] Public Partial Class Form1 Inherits Form Private list1 As List(Of String) Private list2 As List(Of String) Public Sub New() InitializeComponent() list1 = New List(Of String)() From { _ "a", … | |
Re: You mean you want to create a filter over data depending on just one column? Like for example you have coustomers in gridview with columns: id, name, lastname, arress, born,... ... and now you would like to create a filter my name (for example) to show only customers with this … | |
Re: Sure, you can use OldDBConnection class. Check [URL="http://msdn.microsoft.com/en-us/library/5ybdbtte(v=vs.71).aspx"]here[/URL] for details. | |
Re: Use breakpoints, and tell us where exactly error occurs. | |
Re: [QUOTE=PutingPanday;1768316]HELP I NEED TO GENERATE A RANDOM ID FOR MY EXAM... NEED TO GET THE FIRST 3 LETTERS OF THE FIRST NAME....How do I do this?been searching for hours.. [/QUOTE] Just as simple as waqasaslammmeo explained!! Use Substring() method. 1st number inside brackets is starting index (in your case is … | |
Re: Can you be please MORE precise about the issue. What checkBox, what table, ... | |
Re: You had some error, this should work now: [CODE] Dim myqry As String = "UPDATE tblReceive SET " myqry += "ProductName = '" + txtProd.Text & "', " myqry += "Quantity= " + txtQuan.Text & "', " myqry += "Quantity Unit= '" + ComboBox3.SelectedItem & "', " myqry += "Category … | |
Re: Hi, check [URL="http://code.google.com/intl/sl-SI/apis/contacts/docs/2.0/developers_guide_dotnet.html#Retrieving"]here[/URL] for all the info needed (scrool down to "Retrieving contacts" to get sode snippets). | |
Re: Iam affraid, you will ahve to use FormClosing event to get the event of that X button for closing form! | |
Re: [CODE] Dim sql As String = "INSERT INTO Enrollments (Student_ID,Enrollment_Date) VALUES(@param1, @param2)" db = dbs.Connect db.Open() Dim cmd As dynamic = New OleDbCommand(sql, db) cmd.Parameters.Add("@param1", SqlDbType.Int).Value = "Some id number" 'change this to int!! cmd.Parameters.Add("@param2", SqlDbType.DateTime).Value = "Some date" 'change this to date!! cmd.ExecuteNonQuery() db.Close() [/CODE] | |
Re: You can do it this way: [CODE] Private r As New Random() Private tbs As TextBox() 'method for creating textBoxes: Private Sub CreatingTextBoxes() tbs = New TextBox(4) {} Dim locX As Integer = 20, locY As Integer = 20 'setting initial location of 1st textbox (20, 20) For i As … | |
Re: All you need to do is: 1)Create a dataset (and datatable inside of it). You may pull the table from your listView 2)At the crystal report, right click your report and select database expert, add in the dataset u created 3)Design your layout of your report. | |
Re: You are a bit off in this case RFID. If you want to learn array, dont use these kind od examples, there are way better ways to get the data from persons. The simpliest way would be: [CODE] class Program { static void Main(string[] args) { Console.WriteLine("Hi, please insert data … | |
Re: 1st do not create any columns for dgv! They will be created automatically when binding data. Then use this code: [CODE] dataGridView1.DataSource = new BindingSource(ds.Tables[0], null); //ds is a reference of dataSet, while Tables[0] is the 1st dataTable from DataSet. //if you have more then one dataTable, if you want … | |
Re: 1. are you sure you did select an item in comboBox? 2. about sql where clause: are you sure label3.Text property holds same column name as its in the dataBase? 2.1 and if the searchTbx.Text property holds the name that exists in that column? If any of these 3 questions … | |
Re: Can you show us the code you have there? Maybe it would be better to use the code in overriden event OnShow (form`s event). In datatable, the column for "checkBoxes" is type of boolean, right? If so, only check if value of cell is true, or false, like: [CODE] //loop … | |
Re: Where do you want to store the read rows from database? And why? This sounds a bit strange. | |
Re: Exactly as memorath explained. People are mixing these kind of expressions all the time. | |
Re: Simpliest way is to use a text file - where items will be saved. When loading read the file and fill comboBox (or fill DataTable and bound it to comboBox), then when new insertion (if it is) made, save (you can overwrite the existing file, or add a new (last … | |
Re: What about this kind of loop: [CODE] int temp = 0; for (int i = 1; i <= 10; i++) { for (int j = 0; j < i; j++) { Console.Write(++temp); } Console.WriteLine(); } Console.ReadLine(); [/CODE] | |
Re: You have to manualy write the full path to the YourDB.mdf file. So repair the path in theconnection string. | |
Re: For forms which are opened for some small amout of time, like Login form, best way to close them (because they have to close sooner or later) is to use the "using" keyword and a ShowDialog() method: [CODE] //on your class from where you call login form: using(LoginForm login = … |
The End.