ill get the obviuose out of the way. I have XP Pro, VB2010, query(read only) to an ODBC db, displaying several results in a text box. How can I make the data display w/o the the numbers displaing decimal places. These are quantities that are to be displayed not pricing, ie. the result would say 7.0000 qty on hand, and it should say 7 on hand. The code is below,
I have a project in Visual Studio 2008 and there is a working data connection to a MySQL database. In other words, I can query the db directly from Visual Studio and it will display the results.
I've tried a couple of approaches that I found online for writing a connection string and accessing the db, but no luck yet.
All I'm trying to do is code a button to query the db and then reset the text property of a label/textbox to display the results based upon another label/textbox value.
The pseudo-code I am imagining is something like this:
Private Sub query_submit_button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles query_submit_button.Click result_textbox.Text = SELECT field FROM table WHERE otherfield = key_textbox.Text End Sub
I didn't see any related questions posted on SO - forgive me if I missed one that already exists and this is a dupe.
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 am putting this query in my querybuilder in the table adapter but i need to make the query only return the transaction done today!! i dont know the syntax to get the cuurent date today. this query should work in the tableadapter query configuration wizard!!!
Unable to create a parameter query using the table adapter wizard to process an access db file. Went online and attempted to create an instance for new adapter with out success, when I click finish the wizard does not like the in the query WHERE (Last_Name LIKE @Last_Name). Also receive a warning that my code contains to many arguments for 'txtLastName.Text' Tried to paste screen
Public Class FindMemberForm Private Sub FindMemberForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
I have setup an OleDbConnection and my query works just fine but the problem I am facing is that I want the entire query not just a certain row or column. I also would like to place this entire query into a blank excel spread sheet.[code]
If this is in the wrong section, I have a program that queries a database and puts the info in a specific format in a txt file. Now my problem comes w/ how to format the date.
Should I format the date in the SQL query OR is there a way to take the result from the query and format sometime before it is writen to the txt file? I'm not exactly sure how to do either. Would I need a subquery to get the desired date format?
I am using an access DB and wanted to create a query that returns user's in the db. First I need to check the db to see if it is empty. Then I need to check to see it my query returned any values. How do I go about doing this?
I'm a bit confused on how to grab query results. With VBA i would open a record set and have the results of the query written to that recordset. IN VB.net how can I grab the query result and throw each column into specfic arrays?[code]Now how would I force it to query my DB? I have a connection established already.After the query how can i play with the columnes and place them into arrays?
I had this query sp_msforeachdb 'select "?" AS db, * from [?].sys.tables' when I execute it in sql server, it return multiple results. How I can read all the results in my vb?
I am familiar with the VB6 ADO way of dealing with SQL queries and looping through the record set results.
However, what is the correct way to query a server, cycle through the results, and dispose of my query in VB.Net? All the ways I have been using seem to be unstable and crash randomly.
I have been using the following code:
Public Function GetSQLTable(ByVal strSQL As String) As DataTable Dim table As New DataTable Dim adapt As SqlDataAdapter
I am learning VB.NET and wanted to try and connect to a Oracle.DataAccess with this simple SQL Query but am stuck how to get my results.
Imports Oracle.DataAccess.Client Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click[code].....
I'm trying to execute a SQL query and pull the results into a text file. However, I'm getting an error in the bolded part. I think probably the biggest help would be an explaination of what the code in bold is actually doing. I pulled this from a book but don't think I completely understand. To me it seems like its saying that for each row in table 'extract'. Extract it, and write it?? But it doesn't seem to work that way. When it gets to that part, the error I get says that the row doesn't exist in the table
Private Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExecute.Click Cursor.Current = Cursors.WaitCursor 'hourglass cursor Dim connection As New SqlConnection
Why would a VB/ASPX page not return results for a query which runs fine with other Oracle clients? (Same username) The following code should first output the query and then execute it outputting a single exclamation point per record. However, it outputs the query (as it should), but does not return any rows (nor error). If I copy the query to SQL Plus (or other editor) as the same user, the query returns results.
Why might my code not output any results?
Dim MyQuery As String = "...some query..." Dim Factory As DbProviderFactory = DbProviderFactories.GetFactory("System.Data.OracleClient") Dim myConn As DbConnection = Factory.CreateConnection Dim myCommand As DbCommand = Factory.CreateCommand Dim MyReader As DbDataReader
I have a basic question about using a database with Visual Basic.I'm using a OleDb connection. I have dragged and dropped editboxes from the DataDource view. This automatically places the table navigation- bar on the form. When I run it this works fine.However I want to be able to search within the table, with an SQL statement.How can I connect the results from the SQL query to the navigation bar,such that the editboxes automatically take the values of the record without having to assign every textbox manually?
I need a clarification about using datagridview and query statement. i created a sql express database. In the project has been created a dataset with inside a table. In my form i used a datagridview and in automatic have been created BindingSource, TableAdapter, TableAdapterManager and BindingNavigator.
Till here everything is ok because i can add, delete and save members of the table.
Now i wanted to use another datagridview for a research but i don't understand what to use for do that.
procedure to search in a table using a new query?
I know that have been already done this kind of questions but i don't understant if using bindingsource, sqltableadapter, tableadapter ecc..
So I have coded connection to database and query but when I push button nothing happens. So my question is how can I fix that Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
I'm trying to export data from a sql query into a xml document. I need to automate this process because I have over 40 of these type queries that I have to post shortly after midnight each day. I've been trying to figure out how to do this for a few days now.
I'm not sure how to do the following (in VB.NET), I'm hoping you will give me some insight or examples on how it can be done. My database is an SQL one.I have an assets table, which in it has the amount, growth percentage, income percentage. There are multiple assets per client.
I need to get the amount, growth and income into three separate boxes or variables and I'm not quite sure how to do this. The only other problem is that there would be two or three rows returned also, which need to have those three variables or textboxes again. So for x amount of rows, I need 3 variables which the amount, growth and income will go into.
The reason I need everything into variables is that I can't find an effective way of showing each assets growth over x amount of years and the income it will produce into a data grid view. I'm able to do it if I specify what the growth and income are on the form, but not through the query.