I'm trying to show some concatenated data in a CheckedListBox so that users are able to select the data for use later on. Here is the code I am using currently:
Dim con As New MySqlConnection
Dim theQuery As New MySqlCommand
Dim theTables As New DataTable
Is there a way to show the value retrieved by an SQL statement in a message box? In context, my SQL statement searches my database to find a customer record that matches the details entered into the text boxes on the form, and retrieves the CustomerID. Is there a way to show this CustomerID in a message box?
The SQL code is: SELECT customerid from customer where cust_forename = @custforename and cust_surname = @custsurname and cust_house = @custhouse etc
Private Sub cmdLogin_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles cmdLogin.Click Dim conn As MySqlConnection
[Code]....
i supposed it can show the result of count(ID), in this instant it is the number of records count on the OUTBOX so the debug.writeline is RESULT, instead of now it is showing "SELECT COUNT(ID) FROM OUTBOX"
I am currently having a headache on how to solve this problem that i am facing. here is the situation: I have a combobox and a list box on the main form. The combobox will get the data from the ms access database. In the database, i have the details of a person's IC, Name and DOB say for eg on one entry I have D215311523C,SHAWN,13/04/1987 So now, my combobox on form load will show the list of dates in the database to allow the user to search base on the date itself by clicking on the selected date. So when the user clicks on the particular date say 13/04/1987, people in the database whose birthday is 13/04/1987 will be shown on the listbox.Meaning to say if i have 3 entries whose dates are the same 13/04/1987, 3 entries will appear. If there is only two entry, then two results will be shown. But now, when i do a single click on the date, one result will be shown. That is correct. But the problem is when i click on the same date again, three of the same results will be shown on the list box. that is it will display : 13/04/1987 13/04/1987 13/04/1987 which is not the case. Then it will show more duplicates of the same results if i click more times on the same date which should not be the case.
Dim n As Integer Dim numbers() As Integer Dim StartFrom As Integer Dim EndAt As Integer
I wanted to put a checkedlistbox in a groupbox with just one item showing and in the mouse enter event show more items by making the height of the checkedlistbox bigger. The problem is, if it gets to a certain height, it disapears at the bottom of the groupbox because thats its parent.
Is there a way of it showing beyond the boundaries of the groupbox ?
I loaded up a checkedListBox with items form a .txt file. The .txt file has itemName, ItemPrice. Every item that gets checked shows up in a listBox on another form. The problem that I am having though is that I need to accumulate the itemPrices of the selected items to show up in a textBox, but the only price that shows up is the price of the item in the checkedListBox that has the focus. I'll add the code to this:
Public Class Form3 'define the Product structure Structure Product Public itemName As String Public itemPrice As Decimal [Code] .....
how to take a query that returns a single row of data and load that data into textbox controls.I know about ExecuteScalar but it is only good for a single column of data from the query.
I have a Query which looks like this (in Query builder VS11)[code]...
so if a user selects the option 'programmeren' in chkbRequirementsm (= the name of a checkedlistbox) in the query it should start looking for all the programmeren with value True.
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim connectionString As String
[Code]....
I'm needing to do is to show in my messagebox.show the date from the sql query that I ran before this. I know that I havent declared a variable in that statement but I'm having a bit of a lapse today and was just wondering how to show that result in my messagebox.show.
I have the code as below: Dim xdTest As XDocument = XDocument.Load(GetXMLPath()) Dim objResult = From xe In xdTest.Elements("Some Element") _ Where xe.Element("strName").Value = strInput _ Select xe.Element("intValue").Value objResult. I cannot access any extension methods for objResult, like .ToList() or .First(). The file imports System.Linq and the project is targeted to .NET 3.5. How do I get the extension methods back?
First time poster and new to ASP programming.I have a functional database to where i am trying to add new functionality.I'm trying to add the idea to check if a returned string is empty, if so get value from a backup table which holds historical information. Here is what i have got for the specific part:
I am facing a problem displaying the result of my "select *" query on the form . Here is my code:
[code]...
But when I write this code and run my form I am not able to see any records present in my database tables being displayed on my form. I have inserted a DataGridView on my form . What changes should I do to my code ?
I am trying to fill a combobox using the results form a query to combine two fields (first and Last name). I cannot seam to get to the query through the table adapter. I can set the binding source and select one of the fields to fill the control but I cannot get to the query's.
I have a sql query which is returning null value below is the section the iID is null.Once debugger reaches this it goes to exception as its result is NULL. How to control debugger from going to the exception.
How do I assign the query result to a variable.I am using SQLlite. Below is the code for retrieving password from the User Table. I need to compare the given password and the given password.
Dim i As String Dim p As String i = txtUserID.Text
I would like to parse the result of entering a query at [URL] the problem is that I cant seem to the post data just right and cant properly open a webrequest to the site.
I have added a query to my form using the sqlDataAdapter object and the wizard.Now I want to show the result of the query in a combox on my form.The combobox is not binded to a data source, but is going to be used for searching a record (but this is for later)
CREATE PROCEDURE [TestProc] AS BEGIN select '1a', '1b' select '2a', '2b', '2c' select '3a', '3b' END
If I execute the following query using SQL Management Studio,
[Code]...
How can I get the three result sets using SqlDataReader? Or even three SqlDataReader's? Or is it possible to get multiple result sets in just one query in VB.NET? Is DataSet my only option?
I have two text box(Start Value and End Value), one datagridview and a search button SQL script= Select id, ContactName from Customers where id between 1 and 5 I want a scenario where when I enter the start value 1 and end value 5 and click the search button it will run the above query and display the result in the datagrid view.
I'm just wondering if it's possibe to get the results from a query and then assign the results to a variable. So I will run a query which will return the names of the tables stored in the database, then I want them to be stored in a variable. So it would be something along the lines of:
Dim strFrom AS String = "FROM " strQuery = "SELECT * FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'Database1'" con.Open()
I have the following code which returns a single row and column of an MS Access database. My goal is to put it into the Text property of a textbox. Can please someone explain me how to do it?
Dim cmd1 As New OleDbCommand("SELECT NOME From FORN_NIB Where NUMERO = ?", cn) Dim P2 As New OleDbParameter cmd1.Parameters.AddWithValue("P2", ComboBox1.Text) Dim Reader1 As OleDbDataReader = cmd1.ExecuteReader() Dim dt1 As New DataTable dt1.Load(Reader1)