I would like to get assistance on how to retrieve data from MS SQL database to view it on a listbox.In my db i have two columns.
Dim mycon As SqlConnection
Dim mycmd As SqlCommand
Dim myquery As String = ""
mycon = New SqlConnection(" . . . ")
myquery = ("SELECT * FROM MYTABLE")
mycmd = New SqlCommand(myquery,mycon)
Dim dr as SqlDataReader
dr = mycmd.ExecuteReader
Listbox1.items.add(dr.GetString(0)) ' GetString(0) returns data from first column from the result of ur query..
ListBox2.add(dr.GetString(1)) ' Use GetString if item is String, If int then GetInt32 , etc...
Dim Adp as new SqlDataAdapter("select eno,ename from emp","Data source=......your_connection_string")
Dim Dt as new DataTable
ListBox1.DisplayMember=Dt.Columns(0).ColumnName '0 for the eno - first column
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...