|
a service control operation failed for the mssqlserver service :2
the system cannot find the file specified
can you help fast pls
|
|
|
|
|
plz see sqlsetup.log for detail information in %windows% folder.
|
|
|
|
|
i want to make sql statment that use mod % Div /
i have tow colum
tt | time
---------
1 | 1
2 | 2
3 | 9
i want to make list for all record if (time % 5 = 0)
* how can make this
Palestine
|
|
|
|
|
SELECT * FROM MyTableName WHERE time % 5 = 0
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I have three salesmen out on the road demonstrating our latest product on their laptops - an asp.net (1.1) application installed locally on their machine that talks to a SQL Server database instance also installed on their machine.(MSDE 2000)
I would like to send upgrades to them and make the process as simple as possible for them (I can't sell - they can't program!). Carrying out the upgrade via one click would be ideal.
The updates could be anything from appending a single stored procedure to creating new tables etc.
Can anyone suggest a good way of doing this?
Many thanks in advance.
MJ
|
|
|
|
|
I'd write a little .NET exe that has all sql database updates within it. Have a field in a table that keeps track of the database version number. In your little DBUpdate.exe, first thing you do is check the version of their database (If the table or field you keep the version number in isn't there, then you know to start at the beginning...and create the table or field). Then, just run through the updates that are less than their database version number, and update their database version number as you go.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
how to execute tow procedure in one procedure
his job is to add data
|
|
|
|
|
exec <sp_name>
A quick google returns this example[^].
|
|
|
|
|
help me to sort out this problem
i had taken a date time picker and changing the format to dd/mm/yy
sdf
|
|
|
|
|
|
bpavan_2 wrote: help me to sort out this problem
i had taken a date time picker and changing the format to dd/mm/yy
Are you wanting to do this in .NET code or in SQL.
In .NET you'll need to use the ParseExact method of the DateTime class[^]
|
|
|
|
|
If you use SqlCommand with parameters..This an solve alot of problems like formats and sql injection.
|
|
|
|
|
Assume that I have two tables in my database,one is Catgeory and the other is Item.These tables are related; Items can belong to categories. I want to have a business class for categories that represent a record in the category table. I also want this class to contain all information about items belonging to the category. My question is which class is suitable for storing the list for items information.(e.g. Collection,ArrayList,...).I fetch item records in my Data layer as a DataSet. Please show me how I can place data contained in DataSet to the class you think is suitable(e.g. Collection).I need to use this help me please
Hope you undrestand.
|
|
|
|
|
With .net 2.0 and generics..I would use List<Item>
In .net 1.1 I make a class that inherits CollectionBase as a specialized collection for Items.
Also I fill the collection using a datareader not a dataset..This should be faster.
|
|
|
|
|
Have you managed with this??
I also had a similar problem an no-one helped on any where so I tried fixing this myself, and it is working so far.
It's a very confusing subject, and you have to "study" to understand, I don't fully understand the concept, but what I am doing works so far.
I can send you screen shots of my code if you like.
Regards
Brendan
brcvogt@yahoo.com
|
|
|
|
|
Hey. I want to develop a little archive application (Windows Forms 2.0, and C#). I want to be able to install the application on one or more client machines, and have them access a database located on a server in a LAN.
I will be using either MS Access or SQL server 2005 Express Edition. My question is, where and how do I place the database so that it can be used by the clients? What is the smartest approach? Stored procedures? Web services?
I'm having a hard time finding an answer to this. I just need a few pointers to get started
Maybe someone has some experience in writing client/server apps, and could tell me how they usually establish the connection between the client apps, and the database.
If, for example, I use MS Access, would I place the .MDB file in a shared folder on the server, and write the path in the connection string in the client app? Could I do this in any way with SQL server express?
What would be the "correct" way to go about this?
Thank you
-- modified at 3:51 Saturday 2nd September, 2006
|
|
|
|
|
mrgruby wrote: I will be using either MS Access or SQL server 2005 Express Edition. My question is, where and how do I place the database so that it can be used by the clients? What is the smartest approach? Stored procedures? Web services?
I would say SQL Server 2005 on the LAN with Stored Procedures. If you want to ever access it outwith the LAN then Web Services would be a better bet (but the web services would still use stored procedures - one is not a replacement for the other)
mrgruby wrote: how they usually establish the connection between the client apps, and the database.
With an appropriate connection string (like any other way to connect to the database). I'm really not sure what you expected of this answer. Perhaps you need to rephrase your question.
mrgruby wrote: Could I do this in any way with SQL server express?
SQL Server 2005 is a proper database server product. It is not like Access. SQL Server is designed to be accessed by potentially thousands of processes, unlike Access. Therefore, there is no concept of putting SQL Server files in a shared folder as external applications cannot and do not need access to them. They access the SQL Server via various communication mechanisms and the SQL Server process will manage all requests made to ensure efficient access to the database(s)
|
|
|
|
|
Thanks for answering
Colin Angus Mackay wrote: With an appropriate connection string (like any other way to connect to the database). I'm really not sure what you expected of this answer. Perhaps you need to rephrase your question.
When I look around, I find that there are alot of ways to accomplish the same thing. Some argue that one way is better than the other, and vise versa. But I feel that there must be a way that is appropriate and sufficient, without any fancy hacks
All I need is to be able to access a data store, located on a server in a LAN, from any number of client machines. Just like I would access a database on a webserver from an asp.net app. I just don't know how to do it in a windows forms app, where the database is located on a LAN server. Maybe it's a simple answer, that makes me want to hide in shame. I just haven't been able to find it, and I have been looking around alot. Maybe my search criteria is bad, I don't know...
And don't worry, I'm not looking for a finished solution here, where is the fun in that? I just need to know a good way to establish a connection between a windows forms app and a database, in an environment such as the above mentioned.
No reason to walk down a dead end, if I can get the right directions from someone who's been there...
|
|
|
|
|
mrgruby wrote: ust like I would access a database on a webserver from an asp.net app. I just don't know how to do it in a windows forms app, where the database is located on a LAN server.
You just specify the name of the machine on the LAN. www.connectionstrings.com[^] may be of help for you.
Paul
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|
|
mrgruby wrote: But I feel that there must be a way that is appropriate and sufficient, without any fancy hacks
I've never come across any "hacks" for getting database connections to work.
mrgruby wrote: Just like I would access a database on a webserver from an asp.net app. I just don't know how to do it in a windows forms app, where the database is located on a LAN server
Since connecting to the database is the responsiblity of ADO.NET (the part of the .NET Framework that deals with databases) it is the same in a windows application as for an ASP.NET application. Remeber the .NET Framework is divided neatly into areas that can be used on their own to build a whole application. Unfortunately many samples and wizard generated code likes to mash all the different components together so that it is difficult for a person new to .NET to see where one bit ends and another bit starts.
|
|
|
|
|
hi
Can anyone resolve my problem> I create a temp table and inserts data into it through Xml String
, spliting it by the character '|' . The data is inserted into the table fine but for last row it inserts only a part of it and does not inserts (" Remarks=""></item>|) of the xml string.
Can anyo please help or modify...the input xml string will be as given below.
{TO KNOW THE PROBLEM PRACTICALLY COPY THIS CODE IN NEW QUERY EDITOR AND EXECUTE}
--Declaring a temporary @TempTable
declare @TempTable table
(
AutoId int identity,
items varchar(max)
)
--Decaring a Variable
Declare @ExcelDataInXml varchar(max)
Set @ExcelDataInXml='<item TimeStamp="7/22/2006 12:00:00 AM" BlockName="s1" JobcodeId="80" UserInitial="amar" Error1="24" Error2="12" Error3="1" Error4="1" Error5="1" Error6="1" Error7="" Error8="1" Error9="" Error10="1" Remarks=" This is Test Data"></item>|<item TimeStamp="7/23/2006 12:00:00 AM" BlockName="s2" JobcodeId="80" UserInitial="amar" Error1="23" Error2="6" Error3="7" Error4="8" Error5="" Error6="7" Error7="" Error8="" Error9="" Error10="" Remarks="Second remark"></item>|<item TimeStamp="7/23/2006 12:00:00 AM" BlockName="s3" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="8" Error4="8" Error5="1" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="9/1/2006 12:00:00 AM" BlockName="s4" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="9" Error4="8" Error5="8" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="9/1/2006 12:00:00 AM" BlockName="s5" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="10" Error4="8" Error5="8" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="9/1/2006 12:00:00 AM" BlockName="s6" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="11" Error4="8" Error5="8" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="9/1/2006 12:00:00 AM" BlockName="s7" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="12" Error4="8" Error5="8" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="9/1/2006 12:00:00 AM" BlockName="s8" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="13" Error4="8" Error5="8" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="9/1/2006 12:00:00 AM" BlockName="s9" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="14" Error4="8" Error5="8" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="7/22/2006 12:00:00 AM" BlockName="s10" JobcodeId="80" UserInitial="amar" Error1="24" Error2="12" Error3="1" Error4="1" Error5="1" Error6="1" Error7="" Error8="1" Error9="" Error10="1" Remarks=" This is Test Data"></item>|<item TimeStamp="7/23/2006 12:00:00 AM" BlockName="s11" JobcodeId="80" UserInitial="amar" Error1="23" Error2="6" Error3="7" Error4="8" Error5="" Error6="7" Error7="" Error8="" Error9="" Error10="" Remarks="Second remark"></item>|<item TimeStamp="7/23/2006 12:00:00 AM" BlockName="s12" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="8" Error4="8" Error5="1" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="9/1/2006 12:00:00 AM" BlockName="s13" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="9" Error4="8" Error5="8" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="9/1/2006 12:00:00 AM" BlockName="s14" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="10" Error4="8" Error5="8" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="9/1/2006 12:00:00 AM" BlockName="s15" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="11" Error4="8" Error5="8" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="9/1/2006 12:00:00 AM" BlockName="s16" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="12" Error4="8" Error5="8" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="9/1/2006 12:00:00 AM" BlockName="s17" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="13" Error4="8" Error5="8" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|<item TimeStamp="9/1/2007 12:00:00 AM" BlockName="sandeep" JobcodeId="80" UserInitial="amar" Error1="25" Error2="12" Error3="13" Error4="8" Error5="8" Error6="9" Error7="" Error8="1" Error9="1" Error10="1" Remarks=""></item>|'
--insert into TempTable
insert into @TempTable select * from SPLIT(@ExcelDataInXml,'|')
select * from @TempTable
thanx
sandeep
|
|
|
|
|
sandeep kumar pundhir wrote: insert into @TempTable select * from SPLIT(@ExcelDataInXml,'|')
I assume that SPLIT() is a UDF?
What does that function look like?
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Yes SPLIT is a User Defined Function
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER FUNCTION [dbo].[Split](@String nvarchar(4000), @Delimiter char(1))
RETURNS @Results TABLE (Items nvarchar(4000))
AS
BEGIN
DECLARE @INDEX INT
DECLARE @SLICE nvarchar(4000)
-- HAVE TO SET TO 1 SO IT DOESNT EQUAL Z
-- ERO FIRST TIME IN LOOP
SELECT @INDEX = 1
-- following line added 10/06/04 as null
-- values cause issues
IF @String IS NULL RETURN
WHILE @INDEX !=0
BEGIN
-- GET THE INDEX OF THE FIRST OCCURENCE OF THE SPLIT CHARACTER
SELECT @INDEX = CHARINDEX(@Delimiter,@STRING)
-- NOW PUSH EVERYTHING TO THE LEFT OF IT INTO THE SLICE VARIABLE
IF @INDEX !=0
SELECT @SLICE = LEFT(@STRING,@INDEX - 1)
ELSE
SELECT @SLICE = @STRING
-- PUT THE ITEM INTO THE RESULTS SET
INSERT INTO @Results(Items) VALUES(@SLICE)
-- CHOP THE ITEM REMOVED OFF THE MAIN STRING
SELECT @STRING = RIGHT(@STRING,LEN(@STRING) - @INDEX)
-- BREAK OUT IF WE ARE DONE
IF LEN(@STRING) = 0 BREAK
END
RETURN
END
|
|
|
|
|
Your @ExcelDataInXml string is longer than 4000 characters, and your Split function only accepts 4000 characters.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Hi,
I have an ID field and it has been set to increment by 1 every time a record is added.
When I exported this table to another database server, it "lost" this identity. Now when I tried to select Modify from the menu, I keep on getting a SQL problem and then management studio closes. So my only other solution is to use a sql script to change this identity to IDENTITY (1, 1).
How do I do this??
The table name is Orders, and the ID field is OrderID_PK int, this is the primary key.
How do I keep the identity as it is when I import a table from one database to another??
I am using SQL Server 2005.
Regards,
ma se
|
|
|
|