I'm trying to write a visual basic. NET program for my Programming class. I am having trouble inserting names into a list box, I know how to do numbers, but I cannot figure out the codes for names. These five are the ones I need to insert:\n\n Me.uiNameListBox.Items.Add("Smith,Joe")\n        Me.uiNameListBox.Items.Add("Jones,Mary")\n        Me.uiNameListBox.Items.Add("Adkari,Joel")\n        Me.uiNameListBox.Items.Add("Lin,Sue")\n        Me.uiNameListBox.Items.Add("Li,Vicky")\n\n..Thanks for the help.
199782
You do it like this:\n\nDim objItem As New ListItem()\n\nobjItem.Text = "Text To Appear"\nobjItem.Value = "Value of Selection"\nMe.uiNameListBox.Items.Add(objItem)\n\nobjItem.Text = "Second Text"\nobjItem.Value = "Second Value"\nMe.uiNameListBox.Items.Add(objItem)\n\nand so on, and so on.
445112
goto this site for VB.Net and C# :\nhttp://www.samspublishing.com/articles/article.asp?p=31560&seqNum=1&rl=1\n\ntry to find for ASP in internet, i'm too sleepy right now.\n\nbtw, why didn't you open the sample source code from VB and ASP, there's must be a sample source code with 2 or more form.
29944
Actually when you're in Excel you can add a Visual Basic line that makes a SQL query that selects one random name. I don't know the particulars, but I know it's really really easy and it's literally one line of code or two.\nYou could also have two excel files, and one of them acts as a "filter" of sorts, by bringing "external data" from the second one and filtering with the SQL statement.
450656
If it's a textbox,\nstring strVal = txtControl.Text; // you can aldo do .Text.Trim();\nIf it's a dropdown\nstring strVal = (string) ddlControl.SelectedItem.Value;\n\nSome objects have string properties (.Text) you can access directly and store into string variables; others have "object" types (.Value) that you'll need to cast.  Then you can also convert them to other types by writing\nint iVal = Convert.ToInt32(strVal);\nfor free-hand input, beware of conversion exceptions.\n\nYou can collect the user input either upon clicking of a button (set up an event handler for the button's Clicked event) or by handling the TextChanged or ValueChanged events of controls.\nCreating event handlers is best and most accurately done via the designer.
154612
hey man you need to add a new reference first, the in code behind use it. ie: my reference is Ajax, then I click right click on References / Add new Reference / select the reference to be added 'Ajax' / OK. Now in code behind : using Ajax;\n\nand that's all\n\nthen you can use all the Ajax resources, easy uh?
117334
Try using an includes file. If you have the VB script, then you can either put it into a file called VB.inc and then reference it like this:\n<!--#include virtual="VB.inc"-->\n\nThis should all you to use the code you currently have in your site. If you want to write to the page, try using\n<script language="visualbasic">\n//your script here.\n</script>\n\nFinally you can save it as a vbscript and reference it as shown above. \n\nGood luck!
374517
Dim i, total As Integer\ntotal = 0\nFor i = 0 To Integer.Parse(TextBox1.Text) Step 2\n     total += i\nNext\nMsgBox(total.ToString())
20844
write like this way\n\n//code starts here\n\npublic class vehicle {\n   int num_wheels;\n   double load;\n\n  //constructor of vehicle class\n  public vehicle(){\n    num_wheels=0;\n    load=0.0;\n  }\n\n  //set methods of the class vehicle\n\n  public void setNum(int n){\n     num_wheels=n;\n  }//end of set method\n\n  public void setLoad(double l){\n     load=l;\n  }//end of load method\n\n  //get methods of the class\n  public int getNum(){\n   return num_wheels;\n  }// end of method\n\n  public double getLoad(){\n   return load;\n  }//end of method\n}//end of class\n\n//subclass starts here\n\npublic class bus extends vehicle{\n  //add extra attributes that bus have, but the vehicle does not have\n\n  int number_of_seets;\n  //constructor method starts here\n  public bus(){\n   super(); // calls constructor of the superclass\n   // so that we can use attributes of the vehicle class\n   number_of_seats=0;\n   }\n\n //add set and get methods of the sub class\n public void setNumberofSeats(int seats){\n   number_of_seats=seats;\n }//end of set method\n public int getNumberofSeats(){\n  return number_of_seats;\n }//end of get method\n}//end of class\n\nI hope this helps you
527239
It may not be with this line, the error may be from a line above, or so.  It would be easier to answer if you posted both the entire code you have, plus the error message you are receiving.  This way we can check it out.\n\nHint: Post the code and error message as Additional Details for this question.  Have a look at the green bar under your question, at the end you should see an icon that looks like a pen. Hover with your mouse over this, and look down the list that appears.  An item in that list should say 'Add Additional Details'.  Click on this.
491713
I think the most problem lies on your use of datatypes and variables. There is an error assigning teman[0] to some value, as teman is not declared as array of objects. It should be like this:\nteman.word[0] = "something". Anyway, you have set the word access priority to private, so you need to provide the functions to get and set the values into it, such as: public void setWord(int, string) and public string getWord(int) which will insert the word according to the number of element specified by int in setWord, and return the current value of word in getWord.\n\n\n\nNext, teman.putAtPosition("ada",3) and teman.toString() also cant be accepted because you have referred a method to which the object doesnt hhave it. This is again about the teman object which is misreferred by you as a string object.
194458
It may be easier to use an array list.\n\n  Dim al As New ArrayList()\n\n   al.Add("This")\n   al.Add("Is")\n   al.Add("My")\n   al.Add("New")\n   al.Add("ArrayList")\n   al.Add("Control")\n\n   Console.WriteLine("Before Sort:")\n   WriteElements(al)\n\n   al.Sort()\n\n   Console.WriteLine("After Sort:")\n   WriteElements(al)\n End Sub\n\n Private Sub WriteElements(ByVal al As ArrayList)\n   Dim i As Integer\n   \n   For i = 0 To al.Count - 1\n     Console.WriteLine(CStr(al.Item(i)))\n   Next
139150
class Employee {\n   String employeeName;\n   int employeeNumber;\n   String employeeLevel; // you may want to change this to an integer.\n   String jobDescription;\n   double salary;\n....\n}
492004
Since you don't want to create a blank record in the pick list table, the easiest thing would be to, after you create bind your data from the database to the dropdownlist, programmatically insert a blank in the first position of the dropdownlist like so:\n\ndropdownlist.Items.Insert(0, "                   ")\n\nJust remember this has to happen after the data is bound, otherwise the binding will remove the item that you inserted at the first index of the dropdownlist.
452996
Usually MSDN pages aren't the best, but this one is actually really descriptive and has a section on this topic alone. How to edit data through a bound formview. So I will provide you the link below and you can read up on it. It even provides you an example.\n\nRemember to create yourself an edit template and the rest is cake.\n\nEnjoy!
156756
Create a form with textbox named 'txtDiamond' and give it the following settings: 'MultiLine = True', 'ScrollBars = 2 - Vertical'\n\nThen copy the following code within Either Form_Load() or another subroutine in which you would like to generate the row. The following code is dynamic, and allows you to create diamons with the amount of rows being odd or even. I expect alot of points cuz i had to write this myself ;).\n\nHere it is:\n\n    Dim RowCount As Long\n    Dim Row As Long\n    Dim Stars As Long\n    Dim MiddleRow As Long\n    Dim SpaceCount As Long\n    Dim X As Long\n    \n    RowCount = 11\n    MiddleRow = Round((RowCount / 2) + 0.1, 0)\n\n    Stars = 1\n    \n    For Row = 1 To RowCount\n        If Row = 1 Then\n            txtDiamond = String((RowCount + 1) - Stars, " ")\n        Else\n            txtDiamond = txtDiamond & vbCrLf & String((RowCount + 1) - Stars, " ")\n        End If\n        For X = 1 To Stars\n            txtDiamond = txtDiamond & "*"\n            txtDiamond = txtDiamond & " "\n        Next X\n        \n        If Row < MiddleRow Then\n             Stars = Stars + 1\n        ElseIf Row = MiddleRow Then\n            If InStr(1, (RowCount / 2), ".") > 0 Then\n                'Odd\n                Stars = Stars - 1\n            End If\n        Else\n             Stars = Stars - 1\n        End If\n        \n    Next Row
597709
You could add a temporary number column and use autofill to fill it down to the row which contains the last of your name data.\n\nSelect both this column and your name column and sort the name column alphabetically (ascending). Delete the blank rows (which should now be at the top) and then re-sort (ascending) by your temporary number column.\n\nThen delete the temporary number column.
293512
In VBA (as used in PowerPoint) declaring a variable and assigning a value must be separated.\n\nDim astring as String\nastring = "Test"\n\nIn VB 2005, VB.NET, etc. - your expression would be fine.\n\n*** Additional Stuff ***\nSounds like you're really struggling ... In the code module for the presentation you'll need to put the code in a procedure ... here's an example\n\nSub TestThis()\n    Dim astring As String\n    astring = "Test"\n    MsgBox (astring)\nEnd Sub\n\nAfter this, you'll be able to run this code as a macro ... Tools >> Macro >>> Macros ... then select the "TestThis" macro and run it ... you'll get your message box.\n\nGood luck!