|
I'm using Entity , and the code is :
Dim context as new MyEntities
Query=(From t in context.DB1 select t).Tolist
Query2=(From t in context.DB2 select t).tolist
|
|
|
|
|
dilkonika wrote: What can I do Write a console app, and select where 1=1 from your database. Put that console-app in the startup-folder.
It may have multiple reasons; a database-server that isn't active yet, a database that's not yet loaded, the cache being empty, the enumerator waiting until it's enumerated..
I assume you're timing the query from a profiler?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Sorry !
But Select from which table , because I get error with just "Select where 1=1"
|
|
|
|
|
Uhhhh... you don't know much of anything about SQL servers, do you?
I suggest you learn before trying to write an application that uses one.
To answer answer your question, ANY TABLE IN YOUR DATABASE! Use you brain man!
|
|
|
|
|
I never used any command like that. ( Why do I need to select from any table ???!!!! )
for the things that I need on my application I have writed all the sql commands.
For this thing that I doesn't know I thought to ask in this forum.
If you want to help people, is better to give the answer than to insult them.
"Select where 1=1" give errors to me.
Thank you !
|
|
|
|
|
You've never run a command like this against a database?:
SELECT IDfieldName FROM someTable WHERE someCondition
You've never written an application that has used a database before, have you? That's the most ubiquitous query, used by every single application ever written that hits a database engine.
Hey, you wanted to find out if your database was up and running, right?? Possibly get the client "warmed up" so subsequent queries execute faster, right?? What better way than to run a small SELECT against it?
But, hey, after 35+ years of writing code, what do I know...
|
|
|
|
|
I was talking about the command "Select Where 1=1"
In this command "IDfieldname" and "someTable" are missing
Congratulations for your 35+ years of writing code , but I think is better to share with us some of your information without angry.
It's not shame to make even stupid questions.
Anyway , thank you !
|
|
|
|
|
You get an error on that SELECT WHERE 1=1 because it's not a valid query.
That's why I said put a table name in there. Im pretty sure MySQL has a master table or something similarly named.
|
|
|
|
|
dilkonika wrote: Sorry ! Don't be; my bad. The syntax is invalid, because I assumed you alread used such a query. It's a "SELECT * FROM WhateverTable WHERE 1=1 (or 1=0 to get no results); the idea is to send a bogus query whose result does not matter - it's not the result of the query that's interesting.
Performaning the "first" query when the computer starts is a way of cheating. The first query (the bogus one in this case) would still be slow. It would (should) force the db-server to wake up and load all that's required to handle a query.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello,
I am new to ASP.Net so forgive me if what i am asking is too basic.
I need to be able to update some particular cells of a DataGridView control.
The GridView has 5 columns but i want to update only two of the columns when a user clicks the "Edit" link.
My problem is:
1. How do i limit the cells to be updated to those two cells?
2. How do i update those cells by specifying an update query?
|
|
|
|
|
Felix Fosu wrote: I am new to ASP.Net You might want to consider the ASP.NET forum. You might also want to specify whether you mean the default DataGrid[^], or really a DataGridView[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
HI
Is there any way to set the priorities of the Pre-Requisites. I have created a setup in VS2008 and added all the pre-requisites. But not able to set the priority. For Example I have the following products as per pre-requisites:
MYSQL
DbCreate
Dot Net 4.0
I would like the priority to be
Dot Net 4.0
MySql
Dbcreate
Can anyone help me please?
|
|
|
|
|
There is no "priority" support built into MSI. If you want to support this kind of thing, you'd have to wrap your entire installation in a Setup.exe that your write yourself.
This .EXE would check to see if each product is installed and then launch the installers for them seperately.
|
|
|
|
|
SPSandy wrote: Is there any way to set the priorities of the Pre-Requisites That does not sound logical.
It's the installer that determines the priorities, based on dependencies; if DbCreate is using .NET, then it should either be contained in the package for DbCreate, or be listed as a dependency for DbCreate.
Why do you want to influence the order of execution?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for the reply.
I will try to put my doubts in words.
As given in the example, Dot Net4.0 is a pre-requisite for the installation of MySql. And MySql is a pre-requisite for the execution of DbCreate.
This is the reason I am a little confused whether it will run according to this steps or will it just run whichever comes first.
|
|
|
|
|
SPSandy wrote: As given in the example, Dot Net4.0 is a pre-requisite for the installation of MySql. No, it's not. MySQL does not NEED .NET 4 to run.
IF it did, then the package that installs MySQL would need to install .NET 4; it would not be a separate install.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I am sorry but it does need Dot Net 4.0 to install and it does not come with the installer. It has to be installed separately. At least this is true for MySql Server 5.1
|
|
|
|
|
SPSandy wrote: I am sorry Don't be - you obviously tried it, and I'm merely whining about how they should have created their installer.
I've been Googling a minute for an MSI that includes .NET 4, but can't find it. Will be looking for a place to complain next.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have actually solved the problem of defining the steps for installer.
|
|
|
|
|
Hi
Thanks. I was able to sort out according to the required steps.
This issue can be treated as closed.
|
|
|
|
|
Hello which is the best way of connecting VB6 application with sql serverv 2000 ?
|
|
|
|
|
VB6 support ended in april 2008. Support for Sql Server 2000 ended in april 2013[^]. The combination will be limited to 32-bits, and, hence, 32-bit libraries and controls.
The "best" way to connect a VB6-application has not changed; you'd use ADOX as described. There's enough examples on the internet[^].
I'd also like to point out that there are FREE alternatives to the tools you named; VB.NET can be downloaded for free (search vb.net express) and same goes for Sql Server (search for sql server express). There's a LOT more examples on using those, as they have replaced the older tools.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello !
I have an application on Visual Basic 2013 , Entity Framework 6.02 , Sql server 2008R2.
I have several identical databases.
on design , I have created through wizard the connection with one of them ( For example MyDB1) and I have configured the Entity. Now , on runtime , I want to give the users the possibility to disconnect from the database MyDB1 and to connect to another (identical) database for example MyDb2.
How can I do this through code ?
Thank you !
|
|
|
|
|
There are two things you have to do. The first is change the connection string to whatever you need.
All you have to do is replace the part of the connection string that specifies the database and/or server name the database is on.
The second is that you have to wrap your DbContext class with a partial class and supply a new constructor that accepts a connection string:
Partial Public Class MyDbContext
Public Sub New(connectionString As String)
If String.IsNullOrWhiteSpace(connectionString) Then
Throw New ArgumentNullException("connectionString")
End If
Database.Connection.ConnectionString = connectionString
End Sub
End Class
Whenever you need to create a new instance of your DbContext, you just pass the connection string to the wrapper which will pass it to the ConnectionString property of the DbContext for you.
|
|
|
|
|
Hello !
But how to change the connection string ?
As I can see inside visual studio , the connection string is inside the app.config.How can I change on runtime the part that specifies the database and server ?
For the second thing , where should I put the code ?
And finally , let suppose that I have a textbox where I write the name of the database that i want to connect. And I have a button that make the connection. What code should I pass to the button.click event ?
Thank you !
|
|
|
|