|
I posted this question on MSDN as well and got a reply, which although it was wrong gave me the direction. In the application dialog I changed the setting for the database from "Include" to "Data" and then it deployed successfully.
|
|
|
|
|
What method of deployment are you using?
|
|
|
|
|
|
Where is your database publishing to, and where are you expecting it to publish?
ClickOnce kinda takes over when it comes to putting files in whatever locations. It stores some stuff at kind of a master level, then some stuff it will put into windows user specific folders. Something like:
C:\Documents and Settings\WindowsUserName\Local Settings\Apps\2.0\Data\PA61NQME.N93\0BG3BVYZ.BGR\AnotherWierdFolderName\Data
Where several folders are named with some random characters. This will be a different path on EVERY user's computer. So in your code you can't specify this path with a constant. You can reference it with this, though: My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData
If you are new to using ClickOnce, I recommend reading up on it. If you plan to publish different versions of your app, you'll want to make sure you've got all the right settings, etc. Or the second version of your app may cause the database to overwrite when a user updates. Here are some references I've used:
microsoft's documentation[^]
More about data directory[^]
...there was another article that really helped me get started but I can't find it. I'll do some more looking and post if I find it.
Hope this helps.
|
|
|
|
|
Hi
I want to select records 11 to 20 in sql server. In MySQL this is how it is done. How can we do it in SQL SERVER 2005 and above?
SELECT * FROM employees LIMIT 10,10;
In MySQL, LIMIT x,y means skip the first x records, and then return the next y records.
Thanks
Pankaj
|
|
|
|
|
You need to use ranking function which are available in microsoft sql server.
|
|
|
|
|
select top 10 from employees where id between 11 and 20
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
what is id here in your select?
Basically, what I am looking for is to select rows paging like functionality. I don't want to bind any table column in select.
|
|
|
|
|
ID supposed to be column name of your table Employee.I used name ID of column but it may be different name.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
It is pretty simple in SQL SERVER 2005 (onwards) too.
Use ROW_NUMBER() function.
I have a table(say CHOOSERECORDS) with only 1 column(say RECORDS) of type int(Created for answering you question only)
Now I have inserted values from 1 to 100 there.
Next I want to select records from say 11 to 20. The query is here
SELECT A.RECORDS FROM (SELECT ROW_NUMBER() OVER (ORDER BY RECORDS) AS ROWID,RECORDS FROM CHOOSERECORDS) A
WHERE A.ROWID BETWEEN 11 AND 20
Hope this answers your question.
Vote me please
Niladri Biswas
|
|
|
|
|
Thanks Niladri. Exactly what I was looking for.
|
|
|
|
|
I can't figure it using the data GetSchema() returns.
Is there something I don't see?
Is there any other way?
Thanks!
Edit: I'm using SQL Server 2008 and SQLConnection
|
|
|
|
|
try linking the sysobjects table to the syscolumns table and find the datatype in the syscolumns table.
I'll try to come up with the query later.
|
|
|
|
|
Here is some code I found ...
Set the @tblName variable to the name of the table you are trying to find the Identity column and you will get the result.
Happy Coding
<br />
declare @TblName sysname<br />
<br />
set @tblName = 'Your table name'<br />
<br />
-- show identity col name<br />
select syscolumns.name from sysobjects <br />
inner join syscolumns on sysobjects.id = syscolumns.id <br />
where sysobjects.name = @tblName and syscolumns.status = 0x80<br />
<br />
-- show identity constraint name<br />
select sysobjconstraint.name from sysobjects <br />
inner join sysconstraints on sysobjects.id = sysconstraints.id <br />
left outer join sysobjects sysobjconstraint on sysconstraints.constid = sysobjconstraint.id<br />
where sysobjects.name = @tblName and sysobjconstraint.xtype = 'PK'
|
|
|
|
|
Thanks!
I have just found another way:
<br />
select COLUMNPROPERTY(OBJECT_ID('Table name'), COLUMN_NAME, 'IsIdentity') as IS_IDENTITY <br />
from INFORMATION_SCHEMA.COLUMNS <br />
I'd prefer to use GetSchema(), but for now I'm using this.
|
|
|
|
|
How to get DST Start dates and DST End dates for different Time zones.I have number of functions which calculate DST-start date and DST-end date.But these functions does not considers Timezones.Because Depending upon timezones Dst-startdate and DST-enddate differs for a particular year.
Thanx In advance.
modified on Tuesday, June 23, 2009 11:09 AM
|
|
|
|
|
how to move data from one db to another db..
|
|
|
|
|
I am Just Know that on the same instance name or different
if you have same instance then i write down the select query as
when u r using database db1
insert into tblabc select * from db2..tblabc
and if you are at remote location then
you have to make the link server
sp_addlinkserver
like 3 sp's are used.
first clear me about your requirements
Thank U
|
|
|
|
|
we need to move data from one db to another db both are in remote location(i.e). both db is in same server.
|
|
|
|
|
USE LINK SERVER
-- ========================================
-- Add Linked Server Access MDB template
-- ========================================
EXEC sp_addlinkedserver
@server = N'<linked_server_name, sysname, NorthwindMDB>',
@provider = N'Microsoft.Jet.OLEDB.4.0',
@srvproduct = N'OLE DB Provider for Jet',
@datasrc = N'<MDB_file_path, nvarchar(4000),C:\AccessDBs\Northwind.mdb>'
GO
-- Set up login mapping using current user's security context
EXEC sp_addlinkedsrvlogin
@rmtsrvname = N'<linked_server_name, sysname, NorthwindMDB>',
@useself = N'TRUE',
@locallogin = NULL,
@rmtuser = N'<MDB_username, sysname, Admin>',
@rmtpassword = <MDB_username_password, sysname, NULL>
GO
-- List the tables on the linked server
EXEC sp_tables_ex N'<linked_server_name, sysname, NorthwindMDB>'
GO
-- Select all the rows from the Customer table
SELECT * FROM <linked_server_name, sysname, NorthwindMDB>...Customers
|
|
|
|
|
Gee...there are several ways. The best way to accomplish this feat of digital magic depends on the version of SQL Server (if indeed you are using SQL Server) you are using.
"My interest is in the future because I'm going to spend the rest of my life there." - Charles F. Kettering
|
|
|
|
|
I don't know about which database you are talking about, but
If it is in SQL SERVER, the answer is
a) Use the Backup and Restore facility
b) Attach and Detach facility
c) Use Link Server for remote connection
If it is Oracle
Use the export and import tool (exp.exe and imp.exe)
Niladri Biswas
|
|
|
|
|
Depending on your version of SQL Server you could also use the DTS Copy Wizard, bcp, or SSIS, or the detach-copy-attach method
"My interest is in the future because I'm going to spend the rest of my life there." - Charles F. Kettering
|
|
|
|
|
Hi
i have a problem when im using CONTAINS OR FREETEXT in WHERE CLAUSE im using MS SQL Server
EXEC sp_fulltext_catalog 'MyCatalog', 'create'
EXEC sp_fulltext_table 'MyTable', 'create', 'MyCatalog', 'idx_MyIndex'
EXEC sp_fulltext_column 'MyTable', 'column1', 'add'
EXEC sp_fulltext_table 'MyTable', 'activate'
EXEC sp_fulltext_catalog 'MyCatalog', 'start_full'
everything is fine when i executed those storeprocedures but when i run the QUERY SELECT * FROM MyTable where CONTAINS(column1,'sal')
i have two record have 'saleh'
but i got 0 records
also when i view the property of MyCatalog i got Item Count = 0
Please help i don't know why i got 0 record ???
|
|
|
|
|
Try something like this;
SELECT column1
FROM MyTable
WHERE FREETEXT (column1, 'sale') or
SELECT *
FROM MyTable
WHERE CONTAINS(column1,'sal*') (Note the * in the second query)
Reference[^] for this answer.
I are troll
|
|
|
|