|
As far as I can see you haven't wired the event. Try adding the following to the button click before you call RunWorkerAsync :
worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
|
|
|
|
|
|
Does anyone know of a good tool to generate database documentation from database schemas and extended properties for SQL Server? I have been looking at DBDesc http://www.dbdesc.com. Any other suggestions?
|
|
|
|
|
|
How do I convert an MsAccess Database into a MySQL Database and is their a free Utility to do so?
|
|
|
|
|
A quick internet search threw up this[^]
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I did exactly this and made the new database follow standards closer then it did in access however I wrote a conversion program without about 10,000 lines of code.
I would think that you could use a utility like this but you might not get the end result that you are looking for.
Humble Programmer
|
|
|
|
|
Hi,
I am having a problem with the below statements
when I give as below I am not getting any records.
declare @list char(100)
set @list = '''wc1'',''wc2'''
select * from iv30300 where trxloctn in (@list)
When I directly give the list I am getting the result.
declare @list char(100)
set @list = '''wc1'',''wc2'''
select * from iv30300 where trxloctn in ('wc1','wc2')
I am working on sql server 2005 version.
I am not able to find out the error.
|
|
|
|
|
AFAIK you cannot use variable to define an in-list with comma separated values. The contents of the variable is interpreted as a single value, not a value list.
Also you wouldn't need the quotation marks inside the string.
For example the following would work:
declare @value1 varchar(100)
declare @value2 varchar(100)
set @value1 = 'wc1'
set @value2 = 'wc2'
select * from iv30300 where trxloctn in (@value1, @value2)
Perhaps you could modify the in-list to a subquery.
|
|
|
|
|
There's an not error, you just can't do it the first way, the in clause doesn't take a variable like that.
|
|
|
|
|
Use XML
DECLARE @CSV XML
SET @CSV = '<key><id>1</id><id>2</id><id>3</id></key>'
SELECT
ParamValues.id.value('.','VARCHAR(100)')
FROM
@CSV.nodes('/key/id') AS ParamValues(id)
Run that and you should get three rows with values 1,2 & 3.
Join that to your query or use in the WHERE clause
Don't forget to parse the XML before presenting it to SQL in case there are any nasties on the input
|
|
|
|
|
Put the values into a table variable and join to it; in our projects we have a udf that parses a comma-separated string and returns a table variable of the data, it's not too hard to make one. Do that and then join to the table variable.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Hi ,
I need to create a tool to copy SQl server database into a mysql database.Could you please help me to get an idea of this ?.Do I need to use transaction?.How to avoid foreigh key conflicts ?
with warm regards.
|
|
|
|
|
Have you checked this article Migrating from Microsoft SQL Server and Access to MySQL[^].
Denver Thomas wrote: Could you please help me to get an idea of this
If you want to create a tool, one way is that:
- you get the schema information from MSSQL and create ddl scripts using MySQL syntax (or execute ddl against MySQL)
- you dump the data from MSSQL and import it to MySQL
If you need, there are several tools to use. For example, you can use SSIS in MSSQL and transfer data with it also bcp can be used to dump the data in MSSQL. Or you can do everything in code (depending on your needs).
Denver Thomas wrote: Do I need to use transaction
Well, since this is a conversion tool it's not necessary since you can always start again from the 'beginning'. Just take care that you don't have to do everything again. For example, if you have imported data to 100 tables and then table 101 fails, you just delete that table's contents and start loading it again.
Denver Thomas wrote: How to avoid foreigh key conflicts
First load data and after that create foreign keys.
|
|
|
|
|
Hi!
I want to open an older Microsoft Access 2.0 database VC++ 6 and MFC.
I've tried with both CDatabase and CDaoDatabase, but I get the same result
with both. It's says that I don't have read access to the table.
The database is orginally accessed from an VB3 application. Yes, it's an old program.
Example,
CDaoDatabase * pDb = new CDaoDatabase();
pDb->Open(db);
CDaoRecordset * pRs = new CDaoRecordset(pDb);
CDaoTableDef * pTd = new CDaoTableDef(pDb);
pTd->Open("MSysObjects");
pRs->Open(pTd, dbOpenSnapshot);
pDb->Close();
pRs->Close();
pTd->Close();
delete pDb;
delete pRs;
delete pTd;
The database is not password protected, and I get the same message with none sys tables.
Regards,
Linus
|
|
|
|
|
I have an ad-hoc report, which has a few functions. When I try to export the output of this report to a CSV file, it just exports an empty file. The value of the property DataElementOutput is set to "Output". But this does not seem to work. Changing the value of this property works for my other reports which do not involve anything ad-hoc. Any tips would help a lot.
Thanks in advance
Akila
|
|
|
|
|
I've had this happen if the report is too complex; for example, with graphs or perhaps some complex groupings.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Hi,
kindly let me know, How to drop/delete constraints using Oracle sqlplus?
thanx in advance
(Riaz)
|
|
|
|
|
What kind of constraint do you want to drop?
For example, if you want to drop check constraint on a column, you first find it's name in system tables (for example in ALL_CONSTRAINTS) and then use ALTER TABLE command to drop the constraint.
|
|
|
|
|
Hi. Is it possible to reset the autonumber of a ID in MS SQL Server?
Regards,
Matjaž
|
|
|
|
|
OK, found it on Google.
I had to run a query "DBCC CHECKIDENT (yourtable, reseed, 34)". Got it off of a . Pinal Dave blog
Regards,
Matjaž
|
|
|
|
|
I'm connecting to SQL Server 2005 Express Edition using C++/CLI.
Here's my code, actually from the book I'm following
#include "stdafx.h"
using namespace System;
using namespace System::Data;
using namespace System::Data::SqlClient;
void main()
{
SqlConnection^ connection = gcnew SqlConnection();
#ifdef SQLAuth
connection->ConnectionString =
"User ID=sa; Password=;"
"Data Source=(local); Initial Catalog=DCV_DB;";
#else
connection->ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DCV_DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";
#endif
try
{
connection->Open();
Console::WriteLine("We got a connection!");
}
catch (SqlException ^e)
{
Console::WriteLine("No connection the following error occurred: {0}",
e->Message);
}
finally
{
connection->Close();
Console::WriteLine("The connection to the database has been closed");
}
}
I copied the connection string from the connection string property when you select the database connection in the Server Explorer in Visual Studio 2005.
And when I execute this i get the following error (exception thrown)
<br />
An error has occured while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error 40: - Could not open a connection to SQL Server)
Sorry for the too wide post
|
|
|
|
|
At least one problem is that you should escape the backslashes, like:
connection->ConnectionString
= "Data Source=.\\SQLEXPRESS;"
+ "AttachDbFilename=C:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\Data\\DCV_DB.mdf;"
+ "Integrated Security=True;Connect Timeout=30;User Instance=True";
Also check that the SQL Server (SQLEXPRESS) service is running in Windows services.
I got a bit confused about the different connection strings and the database location. Is it your intention that your database is running under the service all the time. If it is, you should use a connection string like in SQL Server authentication, with integrated security set to false and without user instance.
|
|
|
|
|
What do you mean you got confused? I copied the connection string from the Database properties in Visual Studio 2005 Server Explorer...
I, at first created the database on another PC, then copied the .mdf and .ldf files of the database from \Microsoft SQL Server\MSSQL.1\MSSQL\Data
directory. After copying, I pasted it in the same directory on the other PC and added a new database connection in the Server Explorer (Visual Studio 2005). It popped up a dialog, to choose a data source I selected Microsoft SQL Server Database File and then pointed it to the files I pasted. Maybe that's why the connection string is different. Although I saw the connection string on the PC in which I created the database originally, it was different.
By the way how do you manually copy a database from one PC to another? The database isn't connected to anything. I'm just using it for education purpose and I'm using Visual Studio 2005 and SQL Server 2005 Express is installed in my PCs.
Anyways the problem is solved... I'll try it out on the other PC and see if it works there too. Thanks
|
|
|
|
|
The confusing part was the connection strings and how different they were:
manzoor10 wrote: // SQL Server authentication
connection->ConnectionString =
"User ID=sa; Password=;"
"Data Source=(local); Initial Catalog=DCV_DB;";
The above means that you connect to a default instance and use a database named DCV_DB, which is running all the time.
manzoor10 wrote: // Windows Integrated Security
connection->ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DCV_DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";
This again means that you connect to a named instance (SQLEXPRESS) on local host and when connecting a database is attached to the SQL Server instance. So the database available only on the instance when this connection exists. Also since the database is located under C:\Program Files\Microsoft SQL Server\MSSQL.1, it gives the impression that the database is designed to be available in the SQL Server all the time.
In many cases database files that are attached to an instance while connecting to it, are not located under that folder (although there's nothing wrong technically). This is because attached db files usually ship as plain files with a product and the product installation may not necessary modify files under a different installation (SQL Server in this case).
manzoor10 wrote: By the way how do you manually copy a database from one PC to another
In many cases it's done by:
- creating a backup on the source and then restoring a backup on target or
- detaching a database on source, copy files to target and then attach the files to the target instance
Currently you do the attaching phase every time you connect but it can also be done only once and then you just use the database.
manzoor10 wrote: Anyways the problem is solved
That's the most important thing.
manzoor10 wrote: Thanks
You're welcome.
|
|
|
|