I have included a database in my program and it works well except that I would like it to open in sorted order based on column 1. It manually sorts by clicking on the column, but I would like it to sort on form opening
I have AutoFilter in place in my sheet. I want to sort data using the AutoFilter itself and not by normal sort. I want the client to see the down arrow on the autofilter button, which tells that rows are sorted on this key.
I have 'sheet' as an object :
sheet.Range("A2").AutoFilter then Or something else ??(Ensure the syntax for VB.Net and not VB Script)
This seems like is should be simple but for the life of me I can't seem to get it. I am using VB.net.I am importing a text file into Excel. Then I want to select everything and sort it based on a cell (A) in this case. So here is what I have so far.
I've got a DataGridView that has a DataTable as it's Datasource. Whenever I sort a column and then edit a cell, after editing the column, the column autosorts so the recently edited cell is no longer in the viewable area. Is there any way to prevent this auto sort from happening and only sort when I click on the columns?
Is there a better way to make a form with multiple buttons opening different things than having a form that has lots group boxes for each tab. So in the begining each box will be invisible and when you click the button the corresponding group box will become visible. Is there any other way?It will be like a background image and it'll have buttons that will mask it with invisible buttons. when the button is clicked it will open the corresponding group box.
In the main form the user can choose to download information from a device.Since this request takes time, when "download information" is pressed I open new form in a separate thread: Private Sub RunDownload()
I would like to know the event order of form which is executed while opening form. I am showing my form using following code and the code in form_load event executes twice. Once when the form variables are initialised and second when form is displayed. I want it to execute once only. form showing code:
I have one DataGridView and im trying for it to show whats in my SQL database. But when i try to open it, it says the file is in use. I found out that SQL Express is using it, but it isnt even open! So how do i close the databse in the SQL Express?
I'm using VB 2008 Express I have 2 Comboboxes, and an Access Database with 5 coloums, I have managed to connect to the database and populate the first combobox.But I then wish to use the second combobox to filter the data further. ie 5 coloumns Country, City, Cinemas, address, Tel.no I wish to use the first combo to select Country, then use the second to select city so that if there is more than 1 city in the country coloumn I can select it and then I wish to display the results of the other coloumns in textboxes/labels
The code below works for clicking on a cell and showing the text in the proper textbox. I am monitoring cell 0 and 2-5. The problem is when I sort the database by clicking on one of the headers that is monitored, the program shows the below error. The error corresponds to the cell position that is monitored. In other words if I sort on the first column (0) then the error is associated with the following [code]....
I have use this code to view my database into my datagird Dim dbPath As String = "Provider=Microsoft.Jet.Oledb.4.0; Data Source=../VG.mdb;Persist Security Info=False" Dim dt As New DataTable Dim ds As New DataSet Dim da As New OleDbDataAdapter da = New OleDbDataAdapter("Select * from Marriage", dbPath) ds.Tables.Add(dt) da.Fill(dt) Now every time I visit that form I have to manually click the column header of "EventDate" to that it will sort Descending. Is there a way to automatically sort it every time I visit this form?
I'm currently patching an asp.net program where I need to be able to send an image to an SQL Server 2005 DB. It works fine when I use the asp:fileupload control, but the trick is that when the user deletes the image, I'm supposed to replace it with an image from the server saying "empty", in code-behind. I know how to open, use and save text files in vb, but I can't find any information anywhere on how to open an image / binary file in a similar manner so that I can use it as an sql-parameter on the update query. Below is an example of how easy it is to use a file from the fileupload control.
The program i'm running doesn't seem to open the database in stead I get this error:"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"ErrorCode=-2146232060Is there a way to fix this error.
I want that when the application exe file is running at that time the database associated with the application shud be closed....Means...I am using the .mdb file.
I am working on VB.Net. I have a sub form with a datagridview, that is being loaded with the criteria taken from another form. Hence this form is called with parameters.
Here is the code that calls the sub form.
Code:
where ds is the dataset to fill the datagridview and rb is the string from a radio button on this form.
Here is the code in the sub form.
Code:
Now, I need to refresh this sub form every -- minutes, depending on how the user wants it to be. For this I have given a NumericUpDown control to select the mins. All this works fine. But how do I refresh the dataset and the datagridview?
I have a module with Main(). I am calling a form1 from this Main(). Why Form1 is not opening. I set Main() to run at the first in my Project propertis. I am using VS2008.Net3.5 VB code.The Code is:
Module Module1 Public frm1 As Form1 Public Sub Main() frm1 = New Form1
i am making a windows form for a company and i am in a mess in getting my database connection to my datagridview by clicking a button and my data should been shown in datagridview. datasets and connection strings.and even i want to print the document.
To open a pdf file in my vb.net application I have used the following code. This is working fine while running from code. But when I am trying to package it through setup project and run in the installed application, file not getting opened. I am adding my UserGuide.pdf file inside Database folder in Application folder of setup project.
Try Dim lStrHelpUserManualPath As String = "" lStrHelpUserManualPath = Application.StartupPath [Code] .....
I want that when the application exe file is running at that time the database associated with the application shud be closed....Means...I am using the .mdb file...is there any way that when the application starts, if the user has opened the .mdb file then it shud be closed and also that when the application is running no one shpuld be able to open the .mdb file....
I have two forms and a button on the first form. What i want is when i click the button the second form to show and the first one to close.But this isn't working with:
I am getting data from an SQL Server database and displaying the data on a Windows form.How do I navigate through the data in a Sequential Order or Sort Order using the the REP_ID number? Example: When I use the navigation to move from one data to the other, can I go from; example: 100001 to 100002 and so on?
Finally is there any hint as to why I am getting the time with the dates? I know it is converted to text but not sure how to remove the time and just get the dates.Here is the entire project code:
Imports System.Data Imports System.Data.SqlClient Public Class frmBindingData[code]......
I am a bit confused on the correct way of opening a form. I generally practiced form1.show to open a form, but i came across the following code to open an form.[code]....
I am creating a simple email application which sends mail from a user's Gmail account, as I haven't worked out how to receive incoming mail yet.I have created a form (frmSignIn) which asks for the log-in info and another (frmComposeMessage) which has all text boxes necessary for composing an email (to, subject, message body).After clicking Sign In on the first form, it should hide it and open the second form, however I get this error:
System.InvalidOperationException was unhandled Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object.
I have form1 and form2 and have when a user clicks on an icon on form1 it shows form2 and hides form1. But how would I get it to when a user closes form2 it will show form1 again?
I have 2 separate projects that i created using Visual Basic 2010. I need to have a Command button in project 1 to open a specific form that i have in my 2nd project.