|
love_man001 wrote: <appSettings>
<add key="string_var" value="data source=host;UID=userstring; pwd=passtring;initial Catalog=Deneme"/>
</appSettings>
--------- >>>>>> <connectionStrings/> <<<<<<----------- (this is where you connection string should come ....)
Did you get OP's point atleast now
Sathy
|
|
|
|
|
class
public static SqlConnection sqlBaglanti = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["string_var"]);
Boya - Badana - Tadilat ve Tamirat Isleri Bir Yudum Kahve Molasi (Coffee) Dügün Nisan ve Gelinlik (wedding)
Google Reklamlarinizi Sadece Siz Yönetin Elektrik Proje Tesisat Projesi Çizimi Illere Göre Nakliyat Firmalari Istatistik
http://www.evdenevenakliyatbul.com
|
|
|
|
|
Plenty of information relating to your problem can be found if you use Google[^].
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi all,
i have a table which contain reocords related to dates . i want to pick last 7 dates record.How can i acheive this task from Proper SQL query. Note that 7 dates does not mean to last 7 days(here it is possible that entry for particular date is missing for example sunday ).
let us consider this thing
i enter record in database table related to dates 21,22,23,24,25,26,27,28,29,30,31 january and 5 february .now i want to pick last 7 days entry. so SQL query return record related to 5 february and 31,30,29,28,27,26 January.
Thanks in advance
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Use the TOP[^] predicate in your SELECT query.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thank You Soooooooooooooo much. It works
i use following query
"select * from table1 where date1 in (select distinct top 5 date1 from table1 order by date1 desc) order by date1 "
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Great. Happy to help
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi,
I'm having csv file which i tried inserting into sql server 2000
table through bulk insert
my bulk insert statement
Bulk Insert TableName From '\\FilePath\FileName.csv'
With ( FieldTerminator = ',',
RowTerminator = '\n'
)
While Executing the SQL Statement,
i'm getting the following error.
Bulk Insert: Unexpected end-of-file (EOF) encountered in data file.
i tried inserting through DTS it works.
but i want to do through Application How to do that.
Please Help Me..
Thanks,
Regards,
P.Prakash.
|
|
|
|
|
Just a guess, but for the final record, is there a row terminator?
|
|
|
|
|
In the CSV File
i think i'm not getting proper row terminator (\n) at the end of the file.
in that case how to proceed with bulk insert?
One more thing while importing the same csv file through dts then i'm able to import the CSV File data to the table.
but i want to do it in the applications.
pls kindly help me.
P.Prakash.
|
|
|
|
|
Hi prakash,
Check for the Extra spaces at the end of the file.If so remove those spaces and retry it.
|
|
|
|
|
Hi
I have permission to a databae that is replicated.. i want to have a trigger on that database table.. is it possible? will the update/insert trigger will work.? my database is updated every 5 to 10 mins..
Please help me out..
Jes
|
|
|
|
|
Yes, you can put a trigger on a replicated table.
We have a table that is updated via replication approximately every 15 minutes; there is a trigger on the table for inserts to create a subset of the data in a table in another database.
Hope that answers your question.
Tim
|
|
|
|
|
Thank you....
Can i have sample of trigger..
i am using code like this:
CREATE TRIGGER test AFTER INSERT ON temp
FOR EACH ROW BEGIN
INSERT INTO table1 SET fld1 = NEW.fld1;
INSERT INTO table1 SET fld2 = NEW.fld2;
INSERT INTO table1 SET fld3 = NEW.fld3;
END;
will this work...??
|
|
|
|
|
To be perfectly honest, I have no idea...
I didn't write the trigger on our table; I just maintain the app now.
My best advice would be: try it and see what happens.
Tim
|
|
|
|
|
thanx for quick response..
Will the error in trigger affet the original table data insertion..??
|
|
|
|
|
I think if a trigger fails, the original insert fails.
But, again, trial and error.
|
|
|
|
|
When I try to execute the following CREATE TABLE command, even directly in Access' query analyzer, I get the message "Cannot create child list for field Table". I can't find any reference by Googling that doesn't refer to binding data grids or navigating away from a record, which I'm obviously not trying to do here.
CREATE TABLE test ( [code] INTEGER)
I tried adding PRIMARY KEY just in case, but no difference.
The table itself *is* created successfully - it seems to be trying to do something after creating the table and that's what causes the error message.
Any ideas?
|
|
|
|
|
Hello all,
As per the title I am curious to learn how, from a source control/versioning perspective, other people manage DB development projects?
As an example I am currently managing a large project with around 20 developers. This project is primarily developed in C# and VS 2005 and sources are stored/versioned using Subversion. Now this all works for the source, but it doesn't quite fit when it comes to controlling the DB.
Currently we have a "DB Scripts" project, that contains all the scripts needed to build a DB from scratch and these are checked in/out using Subversion. However it is a tad cumbersome.
BTW this is all for SQL2005
|
|
|
|
|
We are a much smaller shop, 5 developers, but we use SQL Compare from Red-Gate for deployment, Source safe for source control (this is very unsatisfactory). We expect to move to Team foundation server soon.
SQL Compare is bloody marvelous. User signs off on UAT DB and it is deployed to production with no problems.
Managing the development cycle is more challenging. When there are changes in UAT and the users want to start another round of changes cn be a nightmare!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi friends
i have a table which have record DistrictName,DistrictDiscription
now the the proble is that i want that this record is to be place in to the
other table which have 4 Column
District_Name1, District_description1,District_Name2, District_description2
so that Odd number of rows should be place in
District_Name1, District_description1
and even number of rows should be place in
District_Name2, District_description2
how can i do this When i have no Primary Key and indexer
How can check the rocord of the table one by one in any loop iteration
wasim khan
|
|
|
|
|
wasimsharp wrote: Odd number of rows should be place in
District_Name1, District_description1
and even number of rows should be place in
District_Name2, District_description2
You can only achieve this if you have the means to order the data in the desired way.
What you are doing doesn't make any sense though. Why do you want to do this? There's probably a better way of solving your problem.
BTW, you should have primary keys defined on your tables. Otherwise, how can you uniquely identify rows for CRUD operations?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi
i have a fild in my db with (image) datatype
i write a sp with this code to compare 2 image fild
select isnull(srl,-1) as srlFng from base_info where img =@img
but this error show when i press check sintax
error 306: the text,ntext,and image data tyoes cannot be compared or sorted, exept ehrn using is null or Like operator
can anyone help me in this problem?
thnx
|
|
|
|
|
1)
EXEC sp_addumpdevice 'DISK','XYZ',
'c:\abc.bak'
BACKUP DATABASE student_database
TO XYZ
WITH DESCRIPTION='def',
STATS
RESTORE DATABASE student_database
FROM XYZ
WITH DBO_ONLY,
NORECOVERY,
STATS
EXEC SP_DBOPTION student_database,'dbo use only','false'
-------------
After executing these query,when
"use student_database"
----
Error message is =the database is in middle of processing...cannot use..
2) I also want to delete sp_addumpdevice--"XYZ" and "abc.bak" after completing the task.
If I delete manually the abc.bak from device, then also when going to use
"EXEC sp_addumpdevice 'DISK','XYZ','c:\abc.bak'"---error message will come as it already exist.
How can i solve this.
|
|
|
|
|
simworld wrote: RESTORE DATABASE student_database
FROM XYZ
WITH DBO_ONLY,
NORECOVERY,
STATS
You restore the database with the 'NORECOVERY'-option - this means that the database remains offline and in recovery-mode (normally used within database-mirroring). Remove this option and the first error-message should disappear.
|
|
|
|