- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 2
- Upvoting Members
- 3
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
38 Posted Topics
I currently have some code that gets the overall top 25 frame sales, which is as follows: `Dim FrameCountSelectStr As String = "SELECT TOP 25 Count(Glasses.OrderID) AS GlassesCount, Glasses.Manufacturer, Glasses.FrameName FROM(Glasses) WHERE FrameName <> '' AND OrderDate >= #" & SearchDateStart & "# AND OrderDate < #" & SearchDateEnd & … | |
Re: I would try changing this line `Using cmd As New SqlCommand("SELECT * " & " FROM tblTimesheet " & " WHERE EmpNo=@empno", MyConnection)` to `Using cmd As New SqlCommand("SELECT * FROM tblTimesheet WHERE EmpNo='" & @empno & "'", MyConnection)` where there are single quotes around your variable, since it is … | |
Re: Have you tried referring to the datagrid column by name in case it is not cell(3): `grdView.Rows(0).Cells("chbSelect").Value = True` If you prefer to use the column number, please remember that the first column is usually Cells(0). You may already know that but I am trying the obvious answers first :) | |
I am currently developing in Visual Studio 2008 (Visual Basic) and I have no problem reading, editing, saving, etc. to a 2007 Access database that is stored locally using the following code: [CODE]Dim NotifyDS As New DataSet() Dim NotifyCon As New OleDb.OleDbConnection NotifyCon.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Data\Settings.accdb" NotifyCon.Open()[/CODE] Ultimately I am … | |
Re: It could be the data type of some of your database fields. For instance you have fields called months, days, years ,age, etc. These could be defined as type Integer. If that is the case then you need to leave out the single quotes in your statement: sqlCommand = "INSERT … | |
I am trying to sum a field in my MS Access database that I long ago stored as a string. I was using dbCommand.CommandText = "SELECT SUM(SubTotal) FROM Glasses WHERE OrderDate >= #" & SearchDateStart & "# AND OrderDate <= #" & SearchDateEnd & "#" and this would work for … | |
Re: I use iTextSharp. You can read more about it here: [Click Here](http://itextpdf.com/) | |
Re: What are you trying to achieve here? Navigate to the next/previous row in the datagrid or next/previous cell? | |
Re: Inno Setup is an excellent installer package. You can read more on their website: [Click Here](http://www.jrsoftware.org/isinfo.php) | |
Re: Your INSERT statement looks good, but you do have to wrap your values according to the data type you have it stored as in your database. For example: cmd.CommandText = "INSERT INTO DATATABLE (ID,someString,someDate,someNumber) VALUES (2,'2',#11/23/2015#,16)" cmd.ExecuteNonQuery() A date value needs # around the value, a string needs single quotes … | |
I am trying to insert some values into a database and I have the following SQL: insertString = "INSERT INTO SocialHistory (ExamID, Occupation, SafetyYN, ComputerYN, ComputerHrs) Values('" & CurrentExamID.ToString & "', (SELECT Occupation, SafetyYN, ComputerYN, ComputerHrs FROM SocialHistory WHERE ExamID = '" & LastExamID & "'))" When I execute the … | |
I have a calendar/scheduler that I am coding and I want people to be able to search for the next available date via a few options. One of those options is to only search those dates that are "Monday" for example. I have the following SQL command to retrieve data … | |
I have a database of customers (MS Access database) and I am trying to check out the demographics. I would like to list the top 5 cities and their count (how many times this city is found in my database), as well as the top 5 postal codes and their … | |
I have the following code which prints my datagrid nicely. The problem is that it only prints the first page and cuts off everything thereafter. I know I need to implement the e.HasMorePages = True in some manner but I am unable to get that working. Here is my code: … | |
Re: You can not do a calculation on a string, so try converting the string to an integer throughout your code: "UPDATE books SET quantity = " & CInt(BooksBorrow.qt1.Text) - 1 & " WHERE book_ID = '" & BooksBorrow.TextBox1.Text & "'" | |
Re: Try this ... will automatically unsert the hyphen as they type: 'Formats the phone numbers to ###-####### Private Sub PhoneTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PhoneTextBox.TextChanged If PhoneTextBox.TextLength = 3 Then PhoneTextBox.Text = PhoneTextBox.Text + "-" 'Put the cursor after the last character PhoneTextBox.SelectionStart = Len(PhoneTextBox.Text) End … | |
Re: 'Connect to the Access Database Dim Con1 As New OleDb.OleDbConnection Con1.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & DBFileName & ";Jet OLEDB:Database Password=password" Con1.Open() 'Open the new connection Dim deleteFirstStr As String = "DELETE * FROM TableName" Dim deleteFirstCMD As OleDb.OleDbCommand = New OleDb.OleDbCommand(deleteFirstStr, Con1) Dim deleteFirstRecord As Int32 = deleteFirstCMD.ExecuteNonQuery() Con1.Close() 'Close … | |
Re: For Each row As DataGridViewRow In My.Forms.Main.DataGridView1.Rows DataGridView1.Rows(row).Cells("Column4").Value = "OUT" Next | |
Re: Try doing this (Formats the phone numbers to ###-###-####): Private Sub PhoneTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PhoneTextBox.TextChanged If PhoneTextBox.TextLength = 3 Then PhoneTextBox.Text = PhoneTextBox.Text + "-" 'Put the cursor after the last character PhoneTextBox.SelectionStart = Len(PhoneTextBox.Text) ElseIf PhoneTextBox.TextLength = 7 Then PhoneTextBox.Text = PhoneTextBox.Text + … | |
Re: Instead of cmd.CommandText = "INSERT INTO rental(date_to, date_from)" VALUES (TO_DATE('" & Me.DateTimePicker1.Text & "','dd-mon-yy'), TO_DATE('" & Me.DateTimePicker2.Text & "','dd-mon-yy'))" Try this: cmd.CommandText = "INSERT INTO rental(date_to, date_from) VALUES (#" & DateTimePicker2.Text & "#, #" & DateTimePicker1.Text & "#)" | |
Re: You could do something along these lines: Dim myFormat As Integer = CInt(PriceTextBox.Text) PriceTextBox.Text = Format(myFormat, "##,###,###") Hope this helps :) | |
I have a string of text being sent through a serial port to a text box (Text1.Text). The string has some symbols in in which I am assuming are Hex values. The hex values are Hex(1), Hex(4), Hex(12), and Hex(17). What I need to do is find the position of … | |
I have a form that has a tabcontrol (TabControl1) and within that tab control is another one (TabControl2). I have textboxes on the main form as well as in each of the tabcontrols. In my savebutton event I have the following code: If CheckIfDirtyAfterLock = "Just Unlocked" Then CheckIfDirty(Me.Controls) Else … ![]() | |
I have an SQL select statement that I cannot quite get working. Dim SelectStr As String = "SELECT * FROM Appointments WHERE Doctor = '" & ComboBox1.Text & "' AND AptDate = #" & DateTimePicker1.Text & "#" This works perfect ... however I have 2 more WHERE possibilities ... I … | |
Re: Have you tried going into your application settings and going to the Compile tab > Advanced Compile Options (button at bottom), and changing Target CPU to (x86). It could be that your Windows 7 version is 64-bit and your XP version is only 32-bit. I am not too sure if … | |
Re: One option you may consider, which will actually save alot of database storage, is to save the [B]path[/B] to the image in a [B]text[/B] field in your database. When you are calling the image, just grab the path to the image to be displayed, and you are not saving a … | |
I have the following code that I am hoping to get working. The code will check for available DYMO printers and print the label. You are to create a template label and I saved mine as template.label. In that template label I have a text field referenced as TEXT1. The … | |
Re: Alot of times when I go to open a form I suse the following code: [CODE] If (My.Forms.ChildFormName.WindowState = 1) Then 'WindowState = 2 (maximized) / WindowState = 1 (minimized) / WindowState = 0 (normal) My.Forms.ChildFormName.WindowState = 0 My.Forms.ChildFormName.Activate() Else My.Forms.ChildFormName.Visible = True My.Forms.ChildFormName.WindowState = 0 My.Forms.ChildFormName.Activate() End If [/CODE] … | |
I have the following code which creates a nice little instant messenger for my program. I am running into trouble when I try to send a message to a user that is not logged into their chat window. It waits about 20 seconds, then throws the error message. In the … | |
I have an Invoice.accdb database (in MS Access) that I am pulling into a MicrosoftReportViewer. I am having trouble subcategorizing the data, and was wondering if anyone could offer a little insight please. I would like to display the data as follows: Invoice Date [INDENT]ID Patient Name Pt ID Status … | |
I am trying to use WebClient to download a .zip file from my server. In debugging mode the code works perfectly, but when I deploy my software the file does not even begin to download. After my program checks to see if an update is available, it should download the … | |
Re: You could also add a FileSystemWatcher to your project. In the coding you just add the following properties: [CODE]' Set the FileSystemWatcher to monitor a specific directory FileSystemWatcher1.Path = CurDir() & "\Data\" ' Watch only for changes to a certain file (eg. Setup.accdb file) FileSystemWatcher1.Filter = "Setup.accdb" ' Enable the … | |
Re: [QUOTE=exception;1419856]how to email using vb? how to find SMTP?[/QUOTE] I use the following code in my simple app: [CODE]Private Sub SendEmailButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendEmailButton.Click 'create the mail message Dim mail As New Net.Mail.MailMessage() Try 'set the addresses mail.From = New Net.Mail.MailAddress(FromTextBox.Text) mail.To.Add(ToTextBox.Text) 'set the … | |
Re: Try visiting: [URL="http://msdn.microsoft.com/en-us/library/ms143506.aspx"]http://msdn.microsoft.com/en-us/library/ms143506.aspx[/URL] (Hardware and Software Requirements for Installing SQL Server 2008 R2) | |
Re: Instead of being = Null, have you tried = vbNull or = vbNullString | |
Re: [QUOTE=atv161;96101]I was wondering if anyone knows how to get text from a cell in a datagrid into a message box or text box? Thanks in advance.[/QUOTE] You can get the first cell (ie. cell(0)) of the [B]SELECTED[/B] row, and send it to TextBox1 by the following code: [CODE]TextBox1.Text = ContactInfoDataGridView.CurrentRow.Cells(0).Value.ToString[/CODE] … | |
Hello, I am relatively new to posting in forums, so forgive me if I posted in the wrong area. I am having difficulty with saving changes made to my database. First of all, I can create a patient in the database (MS Access), and save their contact info no problem. … | |
Hello, I am relatively new to posting in forums, so forgive me if I posted in the wrong area. I am having difficulty with saving changes made to my database. First of all, I can create a patient in the database (MS Access), and save their contact info no problem. … |
The End.