Forms :: Showing A SQL Result
Aug 18, 2010
I have the following code in my project:
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.
View 19 Replies
ADVERTISEMENT
Dec 10, 2010
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
[code].....
View 3 Replies
Sep 4, 2009
I have 3 file to compare.[code]Now my problem is it take more than 1 minute to show the output which is very late. I dont know where i did wrong.
View 1 Replies
Mar 16, 2010
I have the following code in my project:
rivate Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim connectionString As String
[code].....
View 18 Replies
Feb 15, 2012
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
[Code].....
View 2 Replies
May 25, 2011
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
View 14 Replies
Apr 29, 2011
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"
View 2 Replies
Jan 9, 2012
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?
View 1 Replies
Feb 23, 2012
I'm working on an assignment where the program needs to calculate and display the total cost for shipping a package, based on weight and whether it is being shipped to Continental U.S., Alaska, or Hawaii. When I click the Calculate button, though, the label that is supposed to display the total is left blank. I've looked through this and tried placing the calculation in different parts/at the end of the "If" statements.
Dim decWeight As Decimal
Dim decTotalCost As Decimal
Dim decDestination As Decimal
[Code].....
View 1 Replies
Sep 30, 2009
I've got two list boxes on a standard form - one listing cities, the other capitals.
If the user selects the correct combo, and presses a check button, a standard msg box is displayed with congrats etc.
If the user selects the wrong combo, another msg box is displayed with a Yes No selection, to the question of if they want to have the correct answer selected for them.
Now, I've got everything working apart from this last part - having the correct answer selected. Here's the snippet of one of the If parts.
Just a word of warning - yes, it'll obviously be 'messy' and probably 'wrong' to anyone who is even half decent at VB.NET, but I've only just started, and it works for me, so that's all for now :-)
ElseIf lstCountry.SelectedIndex() = 4 Then
If lstCapital.SelectedIndex() = 0 Then
MessageBox.Show("You got it right!", "Correct!", MessageBoxButtons.OK)
Else
[Code]....
Just want to stress again - I haven't given up at the first hurdle - I've been trying to figure this out for well over an hour (probably more) now. Whatever combination I try seems to be wrong - when I press Yes it just stays on the currently selected item.
View 11 Replies
Jan 2, 2010
I have built an application where there is a MDI parent form and other forms which i have not declared as Child forms but have set these forms not to show in Taskbar. While the application is running, if i have any of these forms open and i switch over to any other application other than this and when i come back to it, all these forms hide. I cannot reopen it or see it anymore.. Why is this happening?? how can i sustain these forms as it is even when i leave the application.LuxCoder
View 9 Replies
Feb 23, 2012
I have added a MDI parent to my application and assigned all new forms to it (i.e. Form1.MDIparent = myMDI). When i hide and then show a form, it loses all of the data previously typed in the textboxes.
View 3 Replies
May 4, 2010
When my login screen loads, if the user has not created an account the form will close and a form to create an account will appear. However when I code this both forms stay visible, instead of just the one. Where am I going wrong?[code...]
View 6 Replies
Mar 11, 2009
I've just upgraded from Visual Basic 6 to Visual Basic 2008 Express Edition.
1. Show anothor form (ie. Form2)
2. Close Form1.
At present when I use the me.form1 , but both Form1 and Form2 both closes.I would like to press a button or on a timer, to show Form2, while closing Form1.
View 4 Replies
Jun 20, 2009
my scenario is this: I have two forms and a module. Let's call one of the forms MainForm and the other SecondForm. My module is running on a seperate thread to MainForm. A sub routine is triggered in the module, and I want it to display SecondForm.
I understand that I cannot do this directly because SecondForm needs to be called from the UI thread, which is shared by MainForm. How would I go about doing this? I'm guessing that I would have to use a combination of invocation and calls to MainForm to activate SecondForm.
View 1 Replies
Jun 30, 2011
Well I accidently double clicked both of my forms in a project and then they weren't pinned anymore so I exited them out hoping they'd be pinned aghain, but now when I open the project, no forms show up. Just blank blue wall... How can I get the forms back?
View 3 Replies
Oct 21, 2009
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[Code]....
The end result is baffling me here are 2 examples when I debug
Mine: 640.1 * 49 = 31364.9
Debugger: 640.1 * 49 = 31360 ( not right needs to show the correct decimal )
Mine: .775 * 3 = 2.325
Debugger: .775 * 3 = 2.325 ( shows it perfectly???)
View 1 Replies
Oct 28, 2011
Ive made a calculator that estimates how high a model rocket will go. I was intending on making a simulation that will show you visually how high it will go. (Little rocket image goes up and stops at estimated hight) I know how to make a picture box move and everything, but i can only make it move to a set distance.
View 3 Replies
Oct 1, 2010
I am just learning vb.net using vs 2008. I have a small forms app which I have conected to a small, single table 2 column database. I enter some numbers into a text box, press a button and the data gets entered into the dbase. However the only data that gets displayed in the data table I have on my form is the existing data.No new data entered is shown until I close down and restart the app. I have tried many times using statements such as [code]...
View 9 Replies
Jul 26, 2011
What is the difference between the following two statements (in terms of memory management):
Dim frm as New MyForm()
frm.Show()
VS
MyForm.Show()
I am originally a C# developer, how does the second one make sense or even compile for that matter in VB.NET? (Show() is not a Shared/Static method) What is happening in the second case?
View 1 Replies
May 6, 2009
I've been trying to get my head round a problem for days now, I want to read 'File.ini' line by line checking if specific text exists in the file and then display on a windows form weather particular settings are turned on or off.
So far this code works if "TargetText" exists but if it doenst I get an error on the code line: "If line.Contains("TargetText") Then".
[Code]...
It works if "TargetText" existin in a line in the file but if it doesnt exist I get the 'Null Reference Exception. Object reference not set to an instance of an object.' Any suggestions greatfully recieved!
View 3 Replies
Sep 28, 2010
I have the following
[Code]...
and as you can see, I am showing users the next available date open to them is determined with the value dteReturnValue.ToShortDateString .. but what I'd like to do is show the user both the start date and the end date, which will always be +7 days from the field in my database.
View 5 Replies
Jun 4, 2011
When I create an inherited form, after creation for some reason I cant see the form to edit in designer, I mean I cant drag and drop buttons, labels or any control to it since I just CANT see it, I have included a pic of what I see below where Form1 is the Inherited Form. What Am I doing wrong or what is happening
View 6 Replies
Oct 2, 2010
I'm trying to show a Windows Form from a DLL file - it's added to the application's refrences But I can't call the Windows Form from the DLL, I tried to make a function that shows the form but when I try to call that function in my application it says: Reference to a non-shared member requires an object reference How can I show the form? I'm tried to use this method: (it's in the DLL's form)
Public Sub Open()
Dim Instance As Windows.Forms.Control = Me
Instance.Show()
End Sub
View 3 Replies
Apr 27, 2009
I make a program upon sending emails to my friends using smtp. The problem is that I have confusions why my another form will not show until it is not finished sending all of the messages. I want my next form to show how many percent were finished but the problem is that my form will show only until all the emails are sent on my listbox. I put my code on the load event of the for
View 5 Replies
Feb 16, 2012
I am using a MDI parent to house each of the forms in my application. I have a main form and 2 sub forms. The sub forms are opened using the code below. Also, when I am finished entering info into these forms, i am hiding them so that I can reopen them with the same info still entered.
The problem is that when i show the form again, it is blank. Why would this be the case? I am never closing or disposing the form, so shouldn't it just unhide easily?Showing the sub-form(savingsfrm1) and and hiding the main form(riskfrm1)Public savingsfrm1 As Savings
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code]...
View 1 Replies
Mar 4, 2010
following issue I'm having:
I have 2 tables: locations and depot:
Locations:
site_refnbr (primary key)
site_name
depot_refnbr(foreign key)
[Code]...
I need to populate cboDepot's text property with the depot_name, and not the depot_refnbr that corresponds with the Location selected on frm1 from cboLocations.Frm1 has a button, and I'm not sure if I'd have to code this in the button click event, the cboLocation_Selected IndexChanged event, or in frm2's load event.
View 19 Replies
Mar 31, 2009
I have a form e.g. Form1 , which displays a datagridview.
1) On form load, the datagridview doesn't have any data
2) The user clicks on a button called filter, this opens a form where the user can specify parameters to filter the data by
3) This form calls a setData() in Form1, which fills the dataset with the data
This works fine. If I click on a button called controlPanel it launches another form and hides this. E.g.
dim cp as new ControlPanel()
this.hide()
cp.show()
On the controlpanel I have a button that links to form1. If I click on it. E.g.
dim frm as new Form1()
this.hide()
frm.show()
It redisplays Form1 but without any data in the datagridview.
I think the problem is that since I am creating a new instance for Form1 it comes up with the blank Form1. Is there a way to redisplay Form1 so that it retains the data that was displayed last, without having to retrieve the data from the database.
View 1 Replies
Mar 15, 2010
Have anyone developed a textbox where it is possible to display 2 fields in the textbox. We want to be able to show ID + description in the same textbox. (When user enter the textbox description may go away and the user can enter an ID)
View 2 Replies
May 6, 2009
I added a tooltip control in my form and set a tooltip for a checkbox. The tooltip shows fine until I check the checkbox... If I check the checkbox once and uncheck it, the tooltip never shows up when I hover the mouse over it... How to make the tooltip to show on mousehover no matter the checkbox is clicked or not?
View 3 Replies