In Visual Basic 2008 Express with SQL Server Compact 3.5 and the Usual DataSet / TableAdapters, My Query is too long:Changing the names, it is a query like this:
SELECT Table1.*, Table3.*
FROM Table1
INNER JOIN Table2
ON Table1.ID = Table2.T1ID
[code].....
Problem is, Table1 and Table3 have around 10 and 5 columns each, with rather descriptive names, and The Table adapter is insistent on writing all the columns out and therefore hacks off my command. (It won't take * 's, it always says it can't find the column Table1.* )
I've written an SQL query with a lot of 'or's in the 'where' clause: i.e. "SELECT * FROM myTable WHERE col1='a' or col1='b' or col1='c'...etc" I'm trying to run a query in access via vb.net, but I keep getting "Query is too complex" error message. I'm guessing I've hit some maximum limit. Anyone know a way around this, other than just to break it down into multiple queries?
I develop in VB and often I'm writing long TSQL statements in SSMS but getting them into VB is a bit of a pain. I like SSMS during development because I can change the query / structure and test it when there are problems. Some of them become stored proceduresand some of them I just keep in the code.
I like keeping them in the code because when I have a problem with something, I can GREP my projects directory and find the code that does something (that I've forgotten) or someone asks something about how something works, I can look it up. I've yet to find a GREP for stored procedures. Is there such a thing?I've read in a "best practices" white paper how we're not supposed to concatenate super long strings with & _
[code]...
C# handles these things much better than VB. I'm wondering how I can keep my code together during development and searchable later. I had my hopes up when VS 2010 offered implicit line continuation, that this would help my multi line SQL procedures.Again, I was mistaken. Perhaps I could write it all on one line. I'd be interested in knowing if there's a feature that I am not aware of. Well there are certainly many features which I'm not aware of, but I was referring to "long strings".
Is there a easer way of coding in stead of wrighting long long paragraphs like this in one line [code]All of this is on one line and i got lots of info to put down.."The game will begin on your 16th birthday with your mother waking you up. Today you are to go to the castle for the first time. Leave your bed and open your dresser for a Strength Seed. "
In Visual Studio 2008 I am using :Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long To stop input from occuring during a search-replace operation.
BlockInput(True) ' do not allow input during search and destroy Dim cursorIcon As Cursor cursorIcon = Cursor Cursor.Current = Cursors.WaitCursor
Then setting it to false at the end of the operation. It did not work, so I thought maybe it was because I was calling it from a child window, so I created a function in the mainwindow, and ran it like this:
FrmMain.BlockFrmMainInput()With these functions is the Main window:
[Code]...
It did not solve the problem. I thought maybe it was because I was running under the debugger, so I tried compiling and running it debugger-free, but that did not do any better. I am still getting input when I double-click the mouse on either form.
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
however i have always had issues with databases... so i abandoned it and went into web design instead. Php and sql are so easy there is nothing i cant do with them.I created an Sql compact database which i can connect to and navigate using the following code... but that is it. i cant seem to add to db in any way shape or form.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.AddressTableAdapter1.Fill(Me.TestsqlcDataSet1.address) End Sub
Im looking for some advice on the deployment of an application using SQL Compact Edition.My application will only be used by two people on two separate desktops with file sharing enabled.My goal is to deploy the application and have the .sdf file located on one of the desktops in a shared folder. So the other person using the app can connect to that database too.What is the best way to setup the deployment of this so that I can place the DB in lets say c:DBMyDB.sdf
I am new to vb 2008 and I can't seem to figure this out.
When I try to add a database to my project I get this error (Please look at .jpg (Firsterror)
I have selected the correct driver SQL Compact 3.5
It will add the database to the project but the FULL PATH is always incorrect and I can't change it. (Please look at my seconderror.jpg) the correct path is C:SQLSample.sdf
I am trying to compact a Access 97 MDB file. I have found and tried the following code
Private Sub CompactDB() Dim jro As JRO.JetEngine jro = New JRO.JetEngine() jro.CompactDatabase("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<DATAPATH>", _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<DATAPATH>;") MsgBox("Finished Compacting Database!") End Sub
This codes works and seems to compact the file and it appears in the destination folder but when i try to open the new file i get an error "Unrecognized database format 'DATAPATH'"Is there something i am doing incorrect? the database file sizes range from 5Mb to 100Mb+
I need to create a sound if validation fails. Anyone know how to do that? It can be a wave file or any kind of format.
How can i create a sound in .net compact framework 2.0. using vb.net. I saw codes asking to use system.media class. However in compact framework there do not seem to have this class.
Its my first time playing with the sql compact edition. I am noticing a difference vs char fields in a normal sql database. I was wondering if someoen can explain to me how to get the 2 to work the 'same'...Here is my issue I am having.
I'm development an application in vb 6.0 with SQLCE but when I try to make an update in a table I recive an error 3251 or -2147217887 (80040e21) [code]...
In Vb.NET I allways use mdb files to my applications.Now, in this one, I need use the Sql Compact Edition.The code isn't the same to connect to the DB?
I'm using this: DIM connString As String = "Provider=SQLOLEDB;Data Source=|DataDirectory|SITAC.sdf;Password=abc;Persist Security Info=True"
I have the following code which I hoped added a row to my DataGridView and also a record to my database. It does the first part, but not the second. Dim row As DataRow = Me.CCLogDataSet.tblLog.NewRow() row("cc_log_contract") = Me.txt_Log_Add_Contract.Text row("cc_log_registration") = Me.mtb_Log_Add_Registration.Text.ToUpper() row("cc_log_milage") = Me.txt_Log_Add_Milage.Text [Code] ..... It seems to be storing the data in memory? As the data in the DataGridView is persistant, even after a Relaunch of the application. However, why I query the database, there are no records in it.
I need a simple embedded database for a relatively small database size (< 100MB, but in most cases < 20MB) and maximum 1-2 concurrent users/connections on average. It must be able to protect/encrypt it's data with a login.
I have a compacting subroutine which basically call for MSAccess compacting[code]...
It runs without a problem in VB 2005 IDE, no problem at all. However, when I compiled it, and build the set up, and deploy it. It throws up this exception:
"Could not load file or assembly 'Interop.JRO, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
I'm updating an old VS 2003 project to VS 2010. Part of the application uses the old JRO COM object to compact the database. That seems to be depreciated in 2010.