last year i have written a simple application with a listview filled by a sql-server with patient data.When the application opens, then the actual month is displayed. Now i get the db-entries from last year not from this year.Here is the function:
Private Function getPatienten()As DataSet
Dim selStr As String = "SELECT ID, Nachname, Vorname, Dauer, Fachbereich, Datum FROM tbl_station11 WHERE month(Datum) = month(GetDate()) ORDER BY Datum"
Can anyone help me to make a program which include a Button shows the current Month and the year and when clicking the button it shows a DialogBox ith a MonthCalender (this one I have done - the Monthcalender shown on a Dialogbox).Further I want to change the month shown as a Text of the Button when I click other Buttons to make the calender to go backwards or forwards,
Another thing I want to know is how to make the TreeView which expand / reveal another line or something on clicking the "Plus".I am learning only VB 2005 / VB 2008, please give the codes etc for VB 2005 only.
BTW, Can you tell me how to paste a picture in this writing place? I tried to paste the picture to shoow what exactly I want to do, but I couldn't do it.
I have a form that allows users to select file and then it reads the contents, parses the data and then executes a sql insert statement to add it to a database. What I am having issues with is showing real-time results. Currently, I have the import operation take place on the import form within the OnLoad event. The problem with this is it only shows the final results instead of the results real-time. Is there anyway to do this without creating a seperate thread and delegates?
One of the problems with datediff function is that even if the two dates are 31-12-2011 and 01-01-2012,it will show the difference as 1 year.How to overcome this problem?
problem 1: By default the textbox property of textbox is empty and if we want to show something so we change the text property of text box. right. Similarly is it possible for datetimepicker? i mean that date is always appear in datetimepicker both at run time and at design time, but i want that when my form is loaded so datetimepicker appears clear just like textbox is empty, and when i select some date then that date is display.
I've only dealt with firing a single SQL statement at a SQLServer table and returning a single result... easy....
however....
is there a way to fire a dual sql command and load the results into respective tables within a dataset?.. I'm thinking something along these lines (this code of course does not work)
Dim ds As New DataSet Dim dt1 As DataTable = ds.Tables(0) Dim dt2 As DataTable = ds.Tables(1)
i have a table with information on how much tax a company has to pay, and i need to put it into a select case statement that will let me display the results, but i have no idea how to do that. this is the table:
Sales Income OverBut Not OverCompany Tax IsOf the Amount Over $0 $50,000 1% $0 $50,000 $150,000 $500 + 2% $50,000 $150,000 $300,000 $3,000 + 3% $150,000 $300,000 $500,000 $9,000 + 4% $300,000 $500,000 - $20,000 + 5% $500,000
how do i display this? i have no clue where to start..
[code] BUT, in code, watching the locals window for rec.EOF and rec.BOF both return true and therefore no results.Why does this work in VB Query Designer but not in code? If I remove the WHERE statement than the results return fine as expected.But its returning ALL of the results which is no good.
i want to insert booking_no as combination of year and sno(year/sno) into database here iam giving the code as follows,,,,,,,,, here sno stated from 1.........
Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("guest1").ConnectionString()) Dim booking_no, sno As String If Len(sno) = 1 Then
[code]....
but here booking_no was not inserted properly,it was inserted as "0/ ",,iwant to insert booking_no as "2010/sno" ,
Im a beginner in visual basic 2010 im making my first project i created form3 for the search function so i created 2 checkbox to give the user the choice to choose to search by name or by date or by both of them and i created a button search then i created a datagridview to show up the results so im confused now how to start my project. should I start it with if checkbox1 checked then.... or what?
I have written a code which adds some information to a database. No problem with that since the records get inside the database. My problem is that the record I added always shows up on my Search. I tried changing the variables so that none will have the same names between the two forms but it still shows.Example:
1. I added a record of a book which has an id of 1, name of Cisco, and total of 50. I added it thru the debug function.
2. I added a record of a book which has an id of 2, name of Link, and total of 30. This time, I added it directly on the database file itself.
2. I created a search button which will show records depending on the input of the user.If I type "1" for the ID, the first record will appear on the datagrid. If I type "2" for the ID, both records will appear. If I type "3" which I doesn't have any record with, the FIRST record will still appear. To summarize it, the record that I added through the program itself will always show up on the query results, no matter what I type into.
Dim command As New OleDb.OleDbCommand Dim adapter2 As New OleDb.OleDbDataAdapter Dim bkId, bkTtl As Integer
What do i need to put in the search button so the words that i will put in the textboxes on the rightside will show the results on the left?thanks for the reply. i need some codes for pattern.. ll i found in google is searching in a datagridview. i dont know how to put them in textboxes.
Dim id As String Dim title As String Dim country As String
When I launch VB Help and do a search it shows under "Local Help", "Exception from HRESULT:0x8004032E". It lists three results under "MSDN Online", but the large field to the left of it is entirely blank. If I double-click blindly in that blank area it brings up various topics as if they were listed there but invisible. Further, the region under "Contents" is also blank, as is the "Filter by:" field. If I click the down arrow by the "Filter by:" field it brings up an entirely blank menu. If I then click outside the menu box it brings up a message saying "The selected filter contains an error that prevents it from being applied.". What's wrong and how can I fix it?
I uses datagridview for show query results from database which may have 0 to x number of rows. So I made calculation to calculate size of underlaying form and my datagridview dependable on number of matched rows. Underlying form is transparent and all of that looks like user control what appears and works just fine. But here is one issue: Every time datagrid have to grow, black square in that area is showed before datagrid is filled, what is not nice and surely unwanted. Did datagridview have some mechanism to freeze it and show data when populating is finished?
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged Dim tw As Integer = 0 Dim n As Integer = 0 Dim sqlText As String Dim reader As OdbcDataReader = Nothing [Code] .....
I'm making a program when the user clicks the button it displays the number of rolls it took to get snake eyes ( 1 on each dice) I have randomized it and in the Do loop it calculates until it gets the right code. I just need some help with the code that will display in a listbox the results that didn't get picked for snake eyes.
I want to (SQL) select from a table in an Oracle database, and show the results of the query in the VB application, in a Excel like manner (rows, columns, selectable, etc.). Or in a SQL developer manner. How can I do that? Browsed through a lot of tutorials and howtos on the internet, did not get anywhere. I think (and correct me if I am wrong) that it's gotta be something with DataGridView. But I don't know how to create and populate a datatable with the result of as Select statement, how to create a dataset.
I have a routine that has an if else statement at the else part it calls another routine. Within that routine it has a msgbox script. At the part that is actually is suppose to show the msgbox it goes back to the previous subroutine at the else statement and runs again but this time it displays. I have never seen this before.
THe code is posted below.
1 Else 2 Me.lblTurnsLeft.Text = Me.lblTurnsLeft.Text - 1 3 If Me.lbltimer.Text = "0" Then
I have writen the code so you put the number of times you want to flip the "coin" and into a label the results show. I want it to show the % instead of the number of times that the side lands on.
This is what I have so far:
Private Sub value(ByVal count As Integer, ByVal tailscount As Integer, ByVal headscount As Integer, ByVal flip As Integer) Dim FlipCount As Integer Dim strflip As String
So i'm new to working with vba in access and i'm having trouble getting this code to work. What it is suppose to do is take a selected text file and read the original file into a list box. Then there is a second button that when pressed will convert the text file from a pipe delimited file into a tab delimited file and then show the changed file into a new listbox.
Option Compare Database Option Explicit Function GetFilenameFromPath(ByVal strPath As String) As String
I have a textbox1 and button1 and panel1 (which is used as a popup control)i want if textbox1.text="show" then modalpopup control whose id is panel1 will be visible on buttonclick event other wise .... modal popup control panel1 will not be shown ...how to do this ? using vb.net ?
I was convinced that If <expression> Then <statement [:statement]> Else [statements] in concrete form of If a = b Then SayHello() Else SayBye() End has sense. I read article on msdn on If-then-else, but I forgot why I was reading, so I concluded, that snippet above means this
If a = b Then HelloIsSaid : IsNotEnded Else ByeIsSaid : IsEnded But I have tested it now, and I see, that Else without statement is nothing more than decoration. It would be pretty good if it had function I described. Do you think its good request? Or do you know any circumstance where this Else has some function?