VS 2010 How To Know If Action Query Went Ok
Apr 4, 2011
How can I know if my query have deleted a row or multiple rows? I have a listview with items. Now, when user deletes an item, I need to remove it from the listview but only if the delete query was successful? I thought of rescanning the table for the existence of the record but that looked quite wasteful process.
View 3 Replies
ADVERTISEMENT
Sep 17, 2010
in load of my form, i create automaticly some radiobutton in relationship with the number of Categorie in my BD i hope that when i check for exemple the radiobutton1, it show me (" hello all ")
in reality i don't want to show that, but it just for to simplify my question
this is my code for creation of radiobutton : Private Sub Gh_Produit1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[Code]...
View 3 Replies
Mar 28, 2011
a datacontext defined in a module(domain services ado.net ria)a page having add/delete methods whenever any method is executed, it is found that all the previous actions (NEW RECORD ADDITION and DELETION OF RECORDS) are carried out before the new action is carried out normally
this behaviour is not prominent but "when using break points and inspecting the values of the variables and table object to be added to context, it is clear that all the previous actions take place again. even when the datacotext. savechanges is called, even after that still all actions carried out on the datacontext repeat themseleves, when any new action is to be carried out
View 1 Replies
Feb 16, 2011
I want to create a button that when clicked on He will show the Msgbox and after X seconds more MsgBox will show agin.
View 5 Replies
Jul 20, 2011
i can make a button appear in the DataGridView, but i want to be able to load a form when i click on the button, how do i do that? I cant double click on the button to load the code because it will only appear when i run the application
The following code is to display the button
objButtonColumn = New DataGridViewButtonColumn
objButtonColumn.HeaderText = "Edit"
objButtonColumn.Name = "EditColumn"
[Code].....
View 4 Replies
Jun 6, 2011
I am populating a listbox with a large list. The user then has the option of choosing multiple items from this list. I then want to perfrom a few actions on only the selected items.I cant figure out how to only perform the actions on only the highlighted selections.
'I have tried all combinations of
For each Listbx.SelectedItems.ToString in ListBx.Items.ToString
For each Listbx.SelectedItem in Listbx.Items
'etc, etc
''Performing actions here but it is still doing it with all entries
Next
View 1 Replies
May 28, 2011
I am building an application where on a form is a datagridview and textboxes. The dgv and tb are bound to the same table. I am using the dgv to have an overview of the records and the tb I use for editing. Selecting a record programmatically in the dgv is no problem, but the textboxes have to be filled with the same record. Here I have added my code to this far.
If OuderID <> 0 Then
'select the row
For i As Integer = 0 To dgvOuders.RowCount - 1
If dgvOuders.Rows(i).Cells(0).Value = OuderID Then
[CODE]...
I am stuck right now. I want to add (on the dotted line) an performclick action, but a dgv doesn't have a performclick action.
View 2 Replies
Jul 20, 2011
Imports System.IO
Public Class Form3
Const IMAGE_DIRECTORY As String = "C:images"
Dim files As String() = Directory.GetFiles(IMAGE_DIRECTORY)
Dim max_length, i As Integer
Dim s, fname As String
[Code]...
I simply want to have a list of all graphics saved in specified folder displayed as miniatures - this suppose to be a sort of an image browser - it does not have to be done using ListView, so I'm open to any suggestions.
View 3 Replies
Apr 14, 2012
I am creating an Excel Add-In using Visual Studio 2010. My intention was to add a context menu to a cell and perform some action on the selected cell or cells. Here is the code I have got as of now
[Code]...
View 2 Replies
Aug 19, 2010
Here is the code:
Function getData(ByVal id As String)
Dim reader As SqlClient.SqlDataReader
Dim statement As String
[code].....
View 1 Replies
Aug 20, 2011
I reproduced the following code to update a database and I get the error" Operation must use a updateable query"
[Code]...
View 3 Replies
Feb 29, 2012
When Creating a query using the sear Criteria Builder . I keep getting the error : "The schema returned by the new query differs from the base query" what does that mean and how do i avoid this problem in future
View 2 Replies
Apr 20, 2011
I'm having a small issue, but somehow I simply don't see it.I'm trying to get a value from my database according my query:
[code]...
View 2 Replies
Dec 1, 2011
"Select * from Table WHERE ItemNum=2 OR ItemNum=4 OR ItemNum=6"
I use the code above to select ItemNum w/ even number.. but the problem is how about 8 and above? The same with odd number?
View 2 Replies
Aug 6, 2011
I've been able to create a datasource to a db that I have on the machine. However I can't find any place to be able to add an sql query to my connection.
I'm beginning to suspect the express version does not have this functionality. do sql queries from within the vb program.
View 1 Replies
Mar 8, 2011
i need to write query into textbox but i get error message"Syntax error in DELETE statement."
'Define the connectors
Dim oConn As System.Data.OleDb.OleDbConnection
Dim oComm As OleDbCommand
[code].....
View 3 Replies
Apr 10, 2011
I'm using SQLserver 2008 and I have a below mentioned Query working successfully, now my requirement is I want to execute the same code in vb.net (Visual Studio 2010) it is a update Table command so how to convert and run in vb.net
DECLARE @Rt int
SET @Rt = 0
UPDATE DB.dbo.Sales
[code]....
View 1 Replies
Jun 28, 2012
I am trying to query a MSI to get the ProductCode from the MSI so I can later populate a script with the proper ProductCode.During debugging it "looks" like the database is open for read, however if I look at the oDB object I see this "Error = No further information on this object could be discovered" When it tries to do the OpenView on the SQL statement it throws an exception "OpenView, Sql" I believe that is because the MSI really isn't open for read?I have added the reference to the Microsoft Windows Installer Object Library version 1.0.0.0
Here is the code: (I pass the fully qualified path + filename of the msi)
Private Sub GetMsiProperty(ByVal sMSIFilePath As String)
Const sReadMSIDataBaseErrorStr As String = "ERROR: Could not read MSI database!"
Const msiOpenDatabaseModeReadOnly = 0
[code]....
View 6 Replies
Mar 24, 2012
I'm using MySQL with Vb.Net 2010 and Crystal Reports and to be honest I'm a complete noob when it comes to using Sql Queries. The problem is, I want to generate a report that will show the service fee from a transaction a person made while also showing the items bought, and their quantity and prices, basically a bill. I created a command from the data source I created in crystal reports and it contains this query:
SELECT t.transaction_code,t.fee,t.service_type,t.date_sched,total_bill, s.item_code, s.quantity_sold, i.item_description, i.price, CONCAT(p.fname,' ',p.mi,' ',p.lname),p.address FROM tbl_transaction AS t, tbl_sale AS s, tbl_item AS i, tbl_profile as p WHERE t.transaction_code = '{?trans_code}' AND s.transaction_code = t.transaction_code AND i.item_code = s.item_code AND p.id='{?p_id}'
[Code]...
View 1 Replies
Oct 4, 2011
want to delete data from the database where the value of userID field is equal to the value inside txtUserID.Text. I have a problem about my query statement.
View 5 Replies
Apr 10, 2010
I am now able to add a row to Table1 in my database and and to populate some text boxes with that data. Now...one of those text boxes has a piece of data I wish to use as a variable/parameter in a SQL query to then populate several other text boxes. The piece of data in question is the Primary Key in a Table2. I have tried several methods I've discovered online...but nothing is working so far. So far I'm leaning towards the CommandBuilder but am unable to make it work.
View 4 Replies
Apr 17, 2010
I have a datagridview and i want it to display the results from a query. How would i go about doing this. Here is my code so far:
Dim searchStr As String = S_date_menuItem.Text.Remove(0, S_date_menuItem.Text.IndexOf("'") + 1)
searchStr = searchStr.TrimEnd("'")
adapter = New OleDb.OleDbDataAdapter("select * from account where Date= @Date", acctconstr)
adapter.SelectCommand.Parameters.AddWithValue("@Date", searchStr)
that is my query but i don't know how to get my datagrid to display the results.
View 11 Replies
Apr 26, 2011
I added queries to my dataset via the designer. Is there a way to use variables in those queries?
View 1 Replies
Apr 18, 2011
My goal is to make the content of TextBox1 to depend on the value chosen in ComboBox1. My code is as follows:
Imports System.Collections
Imports System.Data
Imports System.Data.OleDb
[Code].....
View 5 Replies
Apr 28, 2011
I have the following code which returns a single row and column of an MS Access database. My goal is to put it into the Text property of a textbox. Can please someone explain me how to do it?
Dim cmd1 As New OleDbCommand("SELECT NOME From FORN_NIB Where NUMERO = ?", cn)
Dim P2 As New OleDbParameter
cmd1.Parameters.AddWithValue("P2", ComboBox1.Text)
Dim Reader1 As OleDbDataReader = cmd1.ExecuteReader()
Dim dt1 As New DataTable
dt1.Load(Reader1)
View 3 Replies
Jan 16, 2011
I'm new here, I have a problem with my query in my POS program.For a product I need to read the price of it, I made a connection with my database, it's succesful I've already tested it. When I click to a button then will a msgbox appear with the price of that product.
POS
Private Sub btnGroot_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGroot.Click
[code].....
View 2 Replies
Jun 8, 2011
Is there a way to make specific queries from a specific table to another, and then export it to VB??. I have an access database, in which I have 4 tables and 1 query. There is one table called "Customers","Gears" and "Articles"; the last one is the relationships with the ID between the tables from Articles, Gears and Customers, becuase a customer may have more than two Gears, therefore the Articles as well.
So in VB I made an interface in which it conects to the database to show in a combobox all the customers, after that if I choose a customer, then it is supposed to show de gear in a listbox which the customer has, but the problem is that it shows all the gears from the query and not the specific one from that customer, also it repeats in the listbox the same gear twice or more. I think it is problem from my query, but I really don't know how to use very well Access, so I am depending on VB. This is the code that I got so far (Note in my
[Code]...
View 1 Replies
Sep 9, 2011
This query fails on a dataset when I add the rating wildcard. The other two are fine but it does not like the %. This works fine if I run the SQL directly on SQL server.
HTML
SELECT Rating, InvDescrption, FullJobNumber, Product
FROM vJobLines
WHERE Product Like ? AND InvDescrption Like ? AND Rating Like The product and InvDescription fields are NvarChar where the Rating is Int32.
View 1 Replies
Sep 3, 2011
I have been working on a simple delete and update thrugh the TableAdapter in Express 2010 and can't get it to update after a delete query. The same TableAdapter works fine when I do an 'Add', but not after the delete. What am I missing? I could use the SQL commands, but would like to use the software commands instead. Here is the delete code:
[Code]...
View 11 Replies
Jul 13, 2011
I wrote this little function to allow me to pass an ArrayList of Strings and then based on the table passed to pre-build a SQLCommand like so
INSERT INTO table` (`column`,`column`) VALUES (`value1`,`value2`);
The function for this is here:
Public Function _SQLInsertBuilder(ByVal values As ArrayList, ByVal Table As String) As String
Dim commandString As String
Dim columns As ArrayList = GetTables(Table)
commandString = "INSERT INTO `" & Table & "` ("
For Each column As String In columns
[Code] .....
Now I know that much like mysql_real_escape_string() VB.NET has a Parameter ability to make querys safer. How could I parameterize the values during the build of the string.
View 8 Replies