1,469 Posted Topics

Member Avatar for ahmed elweshahy

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.

Member Avatar for Mitja Bonca
0
104
Member Avatar for tenorjazz

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]

Member Avatar for codeorder
0
159
Member Avatar for hazeleyez

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]

Member Avatar for hazeleyez
0
293
Member Avatar for gogs85

Check it [URL="http://social.msdn.microsoft.com/forums/en-US/Vsexpressvcs/thread/6fb71753-8ac5-44c5-80fa-733b7258d2ca/"]here[/URL].

Member Avatar for gogs85
0
98
Member Avatar for aksay

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

Member Avatar for aksay
0
166
Member Avatar for cool_zephyr
Member Avatar for vimit
0
588
Member Avatar for Quinncunx
Member Avatar for Reverend Jim
0
2K
Member Avatar for Farhan_B

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 …

Member Avatar for Reverend Jim
0
221
Member Avatar for dilse4sk

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 …

Member Avatar for dilse4sk
0
156
Member Avatar for dilse4sk

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 …

Member Avatar for dilse4sk
0
141
Member Avatar for gozo12

try: [CODE] If listBox2.Items.Contains(listBox1.SelectedItem.ToString) Then MessageBox.Show("This item is in listbox 2.") End If [/CODE]

Member Avatar for Mitja Bonca
0
256
Member Avatar for manal-19

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.

Member Avatar for Mitja Bonca
0
237
Member Avatar for ali.alipanahi

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]

Member Avatar for Mitja Bonca
0
106
Member Avatar for vivekanandaan

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]

Member Avatar for Begginnerdev
0
123
Member Avatar for Farhan_B

is your listbox databound? do you use DisplayMember and Valuemember properties? If you DO NOT, you can NOT get SelectedValue property.

Member Avatar for Farhan_B
0
149
Member Avatar for ng5

[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,..?

Member Avatar for ng5
0
214
Member Avatar for jumboora

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.

Member Avatar for jumboora
0
264
Member Avatar for sah

Get the current process and set its priority. [CODE] System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.Low;[/CODE]

Member Avatar for Momerath
0
438
Member Avatar for F_M

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]

Member Avatar for Phasma
0
676
Member Avatar for abhinav1986

Make your "str" variable as static. [CODE] static string str = ConfigurationManager.ConnectionStrings["Bank"].ConnectionString; SqlConnection con = new SqlConnection(str); [/CODE]

Member Avatar for Mitja Bonca
0
443
Member Avatar for Orbea

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!

Member Avatar for Mitja Bonca
0
144
Member Avatar for skatamatic

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 …

Member Avatar for Ketsuekiame
0
187
Member Avatar for Galindo

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 …

Member Avatar for skatamatic
0
263
Member Avatar for Axladrian

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.

Member Avatar for Axladrian
0
96
Member Avatar for LFCDay123

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 …

Member Avatar for poojavb
0
147
Member Avatar for kamilacbe

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

Member Avatar for kamilacbe
0
163
Member Avatar for TrueCoding

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 …

Member Avatar for Mitja Bonca
0
415
Member Avatar for danthevan

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]

Member Avatar for Mitja Bonca
0
100
Member Avatar for gozo12

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

Member Avatar for gozo12
0
177
Member Avatar for dilse4sk

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 …

Member Avatar for M.Waqas Aslam
0
863
Member Avatar for sirmcfly.works

Sure, you can use OldDBConnection class. Check [URL="http://msdn.microsoft.com/en-us/library/5ybdbtte(v=vs.71).aspx"]here[/URL] for details.

Member Avatar for Mitja Bonca
0
164
Member Avatar for uva1102
Member Avatar for PutingPanday

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

Member Avatar for thines01
0
135
Member Avatar for uva1102
Member Avatar for Mitja Bonca
0
120
Member Avatar for timothy0726

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 …

Member Avatar for kingsonprisonic
0
300
Member Avatar for virendra_sharma

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

Member Avatar for Mitja Bonca
0
132
Member Avatar for priyamtheone
Member Avatar for makdu
0
562
Member Avatar for madao

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

Member Avatar for kingsonprisonic
0
267
Member Avatar for reds8

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 …

Member Avatar for kingsonprisonic
0
221
Member Avatar for jairuz21

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.

Member Avatar for jairuz21
0
968
Member Avatar for RFID

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 …

Member Avatar for dwarvenassassin
0
194
Member Avatar for ali.alipanahi

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 …

Member Avatar for ali.alipanahi
0
159
Member Avatar for prethum

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 …

Member Avatar for prethum
0
120
Member Avatar for itsvineethpv

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 …

Member Avatar for itsvineethpv
0
121
Member Avatar for saneeha.nust

Where do you want to store the read rows from database? And why? This sounds a bit strange.

Member Avatar for saneeha.nust
0
145
Member Avatar for digiguy

Exactly as memorath explained. People are mixing these kind of expressions all the time.

Member Avatar for skatamatic
0
145
Member Avatar for Panathinaikos22

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 …

Member Avatar for Mitja Bonca
0
113
Member Avatar for andur92

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]

Member Avatar for dwarvenassassin
0
608
Member Avatar for judithSampathwa

You have to manualy write the full path to the YourDB.mdf file. So repair the path in theconnection string.

Member Avatar for Pri Bhowmik
0
377
Member Avatar for elshan0011

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

Member Avatar for walid86
0
2K

The End.