VS 2010 SQL - How To Connect Or Perform Queries
Jun 13, 2010
I'm a PHP coder normally, but I've been asked to make a small vb app. I've created my sql db (MSSQL) and have got all the data in it. However, I have no idea about how to connect or perform queries.
Here's my
Private Sub Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[CODE]..........
1) Am I connecting properly? I created a new database using the dataset option and it has no username or password.
2) I'm trying to list the results, which will be clickable to open a new form with the full details. How would I do that?
Eg: In PHP, I'd loop through the resources using fetch_assoc, and create a link with the id and it's name as the firstname and surname.
View 3 Replies
ADVERTISEMENT
Dec 18, 2009
can i perform sql queries on xml files?
View 9 Replies
Aug 24, 2010
I have a program that generates text tab-delimited files with a header row and sometimes a units row followed by data.
Example:
FirstName LastName Birthday
Michael Jordan 6/6/66
Alan Jackson 7/7/77
or
FirstName LastName Birthday
Name Name Date
Michael Jordan 6/6/66
Alan Jackson 7/7/77
I would like to be able to perform SQL queries on these files. How can I connect to a text tab delimited file to either pretend it is a database table or import it into SQL as a table, preferably through VB.NET? I could have 300,000 rows, and the fields are all numbers, not text... I have manually imported these files into SQL before using management studio, so I know it is possible but I would love to be able to do it programmatically.
Is there any way I can get the SQL code from this process because it does exactly what I need it to do but it is manual. There is an SSIS package that I saved, but I do not know what that is.
View 1 Replies
Jan 18, 2012
I am trying to make a vb.net program which will perform WMI queries to check for remote computer's name and OS. I manage to do the first query of name using the code below..
[Code]...
I am getting error "Local variable 'query' is already declared in the current block. (BC30288)".I understand that I am using same name for the object variable for performing subsequent query. Is there a way in which I can dispose the variable completely and reuse it again for querying the new required WMI detail? My search in the net couldn't give me any clue as of how to clear the variable and use it again. The issue is with two variables "query" and "searcher". Is it only possible that I should give unique names to each query object variable as I might add more queries later on?
View 2 Replies
Jan 6, 2010
I am writing a message system on my server, the xml is something like this
<xml>
<entry>
<sender>[code]....
my problem now i guess is 2 fold, i wish to combine the first 3 queries into a single query and place in a list or a collection or is there a way to do this with a single query that will give me my desired result?
View 1 Replies
Jun 18, 2012
I've written an application and I'm trying to utilise a database behind it. I've created a mysql database, and table which all appears to work correctly. I appear to have connected to the db correctly too. And hit a bit of a brick wall. As a side-note, within Visual studio connected to the database using the add data source wizard, I then dragged and dropped my db table's column onto my form that intends to display them all (6 textboxes, including primary key) and that now displays the first record of the table. It confused me, because i did this as soon as I had setup the database with no visual basic code assisting, so there wasn't even a connection string?!
One functionality i want to have is to press a button and cycle through the table's records using the form by the unique id, how would I do this? I'm essentially asking how can I enter a number in a textbox which would then return me the relevant primary key and data attached to that record.
View 1 Replies
Feb 13, 2012
My project contains a DataGridView with a SQL Database Table called Shows. This is a list of TV Shows and I want to apply several filters to it. So I have several different columns to apply the filter to.
1. Completed (bit)
2. Hide (bit)
3. Seen (bit)
4. Genre (nvarchar)
Currently I am using RadioButtons to switch between the queries, but I want to be able to have several filters applied at the same time with CheckBoxes.
[Code]...
View 4 Replies
Sep 6, 2011
I'd like to display the same data in 6 different listboxes but with different queries.The data is formatted as so:
ExptStage
expt1Expt List
expt2Ready to Print
[code].....
View 8 Replies
Oct 15, 2011
I've got everything working except this one problem which I can't seem to get my head around.I've made a function that returns a random number between 1 and 11 (how many invaders there are on a row).I've managed to get this to work, however the invaders will keep firing even if they are visible, so I made a do until loop which says to keep running the random number until it finds an invader which is visible... The problem is that if the whole row of invaders aren't visible, it will get stuck in the loop.
View 13 Replies
Jun 6, 2010
I use an access database and some queries return calculated fields resulting from
functions in the code module of the database These queries are not listed in the "Views" tab of the query designer when adding a tableadapter in the data source designer
View 2 Replies
Feb 29, 2012
This is what i have for my set of columns:
[Code]...
2nd question. How can i bind other queries from different table to these columns. like Column[2]and Column[3] should come from a different query.
View 3 Replies
Dec 31, 2011
How can i perform click to a checkbox using a shortcut?For example:
if control.modifierkeys = keys.cotrol and e.keycode = keys.d then
here? (the .performclick() is not available)
endif
View 2 Replies
Jan 22, 2012
I am trying to perform Zoom and Pan the image in Picture box using the following The Width and Height of the picturebox is (1024,1024).
Private Sub Picturebox1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Picturebox1.Paint
If Mouse_Operation = "ZOOM" then
ZoomWidth = 1024 * Total_Zoom_value
ZoomHeight = 1024 * Total_Zoom_value
[code]....
Total_Zoom_Value and (imgx, imgy) are calculated based on the mouse movements on the picturebox.Now I am able to do the PAN operation after Zoom operation. But If i try to do Zoom operation after PAN operation, I am not able to Zoom the image from the PAN co-ordinates (imgx, imgy). I am not getting how to retain the image drawn using e.graphics.drawimage.how to do the operations on e.graphics.drawimage.
View 2 Replies
Feb 20, 2011
Im new to the forum and planning to stay here to learn more on programming. I would like to ask a question about Getting the Mouse coordinate on the Screen outside the form then Perform a left click or mouse event on the given coordinate what i want to happen is to get the coordinate first then perform click. i already have the code for performing the click but i dont know how to get a coordinate i will not be putting the code because i want to learn and not copy any already made code.
View 8 Replies
Oct 6, 2011
I have DataTable, and is bound to DataGridView. So, when the user inputs some values in 4 columns, it would calculate the sum and put it in the last 2nd last column.
Here's the code that I'm experimenting:
vb.net
Private Sub DataGridView1_RowLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.RowLeave
Dim i As Integer
Dim intTotal As Integer = 0
For i = 5 To DataGridView1.Columns.Count - 3
[Code]...
So, basically it should sum up certain columns when the user enters numbers into it and then display it in the last column.
View 3 Replies
May 11, 2011
I want to know how to perform row delete to datatable which is a datasource to the grid.
In details: I have a datagridview (dg) and its datasource is set to dtItem. User will select some rows in dg and press 'delete' button.
dg.DataSource = dtItem;
I will perform a loop and delete the records. Here is the code eg:
foreach (DataGridViewRow drw in dg.Rows)
{
if (drw.Selected)
[Code]....
The problem is it didn't delete correctly. If user selects row index 0 and 1 in dg and delete it, it will delete the first one correctly and then finished cuz no more row is selected in next gridviewrow.
I tried google and didn't find what I want. may be because i don't know the correct keywords I should use to search.
View 2 Replies
Apr 17, 2012
I am creating an Excel Add-In using Visual Studio 2010. I would like to run some code when users clicks a combination of keys.Here is the code I have got
Public Class CC
Private Sub ThisAddIn_Startup() Handles Me.Startup
EnableShortCut()
End Sub
Sub A1()
[Code]...
The Add-In when installed shows an error on clicking the short cuts. It says the specific macro cannot be found.The code under the Sub EnableShortCut() works well when it is in an excel vba module. The same won't work when it is added to an Excel Add-In created with Visual Studio.
View 4 Replies
Jul 16, 2011
it's just for a program registration. i would store all of the registration codes in the access database, then export it to XML, then upload it to my web host. I would then somehow connect it to my Visual Basics login form (Which I have already made). If this can't be done, having them register through the form and having all the allowed codes on the internet (So i can easily edit them)!
View 5 Replies
May 28, 2012
I was trying to establish a database connection to MS Access but this error keep occurring.
The 'Microsoft.Jet.OLEDB.12.0' provider is not registered on the local machine. I have forcefully set my cpu to x86 but still no lock below is the code how I open it.
Imports System
Imports System.Data
Imports System.Data.OleDb
[Code].....
View 3 Replies
Aug 26, 2010
I am building an application that updates a table in Sybase 12.5.3. Here is my situation.
How can I connect to Sybase 12.5.3 from vb.net 2010? In the past, I have used ODA to connect to Sybase and it worked fine.
The problem is that ODA was removed from VB.net in versions 2008 and 2010.
These Visual Basic versions are now using ASE to connect to Sybase but ASE is for Sybase 15.
I tried using ODBC but the drivers that come with VB.net are for Microsoft SQL.
I tried connecting to Sybase using MS SQL drivers. I was able to connect, but the execution did not work that well.
how to connect and how to execute a stored procedure with input and output parameters?
View 1 Replies
Feb 13, 2012
for example, if i want to create a program that that takes the result of the calculator ( i mean the default calc of the windows ), or the result of any program, and keep these results in my created vb program, or to manipulte these results, is it possible?
View 3 Replies
Jun 13, 2010
im a beginner in visual basic.
View 4 Replies
May 16, 2011
I dusted off VB.net, and now im trying to connect to a local FoxPro DB. Problem is, its not working. Ive been at this for about an hour or so, trying many misc things, but without any luck. [Code]. 'C:aaaCF21000.DBF' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. Suggestions? That path is 100% valid, I can copy/paste that and open up the Database without error. I also tried other code I found on the web, some of them I cant even get them to run.
View 5 Replies
Jan 26, 2011
I had an application wich connects to an oracle DB (built in VB 2008). Now..I am using VB 2010 and the oracle client is obsolete. Therefore I want to change my application to connect to an oracle DB the right way.
View 1 Replies
Mar 23, 2011
I'm trying to write a small app that will connect to our SQL database and run a small query.
However, my first stumbling block is the connection to SQL.
The SQL is on a server called RCSRV01, and RCSRV01 is the name of the SQL Server instance. The database is called NHD
This is my connection code...
[code...]
View 3 Replies
Jun 4, 2010
Trying to connect to my SQL database.Receiving this error:[code]No idea how to fix this, any ideas?
View 22 Replies
Feb 1, 2012
I want to create an application which generates random questions. So, initially, I have a form where I choose some options. They're all "Yes" or "No". According to my answers, I want my application to generate 10 random questions which are written in a Excel file.
It's like:
Option 1: Yes (Generate 3 questions / Excel file: Questions 1 to 6)
Option 2: No (Generate 2 questions / Excel file: Questions 7 to 14)
View 4 Replies
Nov 20, 2010
how to connect vb.net 2010 to ms access database to get the data and display it in vb.net application that I am doing right now. My project is that I am doing dictionary application with vb.net so every time i put new word in search box, I want the vb.net to get the definition from ms access and display it in the application.
View 1 Replies
Sep 7, 2010
I have connected the database itself without much issue but i want to be able to edit, add and eventually delete from the database using Visual basic interface. This is for an A Level computing course that i teach, i remember a long time ago when i did the course this was fairly simple to do however i cannot for the life of me figure out how to do it at the moment. This is further confused by office 2007 and VB 2010 both of which didnt exsist the first time i did this.Connect 2010 to an access database?
View 4 Replies
Oct 8, 2010
How does one connect to an MS-Access 2007 mdf? Need coding example for VB2010.
View 4 Replies