|
myNameIsRon wrote: AND ItemDiscount <> ''
That just excludes the empty string, you also need to exclude the nulls.
AND ItemDiscount <> '' AND ItemDiscount IS NOT NULL
Does this help?
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
|
A small team of software engineers have re-architected the Microsoft .NET Pet Shop application by using Software Tree’s NJDX object-relational mapping (OR-Mapping) technology. Here is the abstract of the project report:
The .NET Pet Shop application is designed to show the .NET best practices for building enterprise n-tier applications. In this ASP.NET based web application, classes are defined to represent domain model objects like products, users, addresses, and orders. These domain model objects are persisted in relational databases (e.g., SQL Server, Oracle) using a data access layer (DAL). The current DAL implementation, which uses raw SQL and low-level database APIs, is pretty hard to understand and maintain This report describes how such a data access layer can be replaced with a much simpler and shorter (35% less lines of code) implementation using NJDX OR-Mapping technology from Software Tree. In addition to greatly simplifying the architecture, the NJDX approach provides greater flexibility and delivers superb performance.
Project Report
Press Release
The full implementation code ships with the NJDX software that is available for a free 30-day evaluation from Software Tree’s web site at http://www.softwaretree.com.
Thank you.
Damodar Periwal
Software Tree, Inc.
Simplify Data Integration
http://www.softwaretree.com
-- modified at 21:50 Wednesday 8th February, 2006
|
|
|
|
|
I need to upgrade our db server and was wondering if anyone had any experience with opteron based processors.
I want to use HP ProLiant DL385 with 2 AMD Opteron 280 processors (Raid 5 and 8GB Ram)
I want to use 64bit version of windows and sql server 2005. (System price around $15,000)
How would this compare to comparable Xeon processor based configuration?
|
|
|
|
|
Hello,
I work with sql express edition which comes with visual studio 2005. I want to upload my database (aspnet.mdf) to my Internet Provider.
I have no idea how I can do that. The provider told me I should create a Backup of my database and send him these file. Now I was looking for an backup option but I cannot find any tool coming with VS which provides this function. Further I also was looking for the Enterprise Manager. But I guess this tool comes only with an other SQL Version.
What can I do to upload my database to my provider in a simple and free cost way?
It would be nice if someone can give me some help.
Chris
|
|
|
|
|
It sounds like your provider wants you to send a copy of the .mdf file that is your sql express database. It is likely your provider uses a full copy of Sql Server 2005 rather than Sql Express and I imagine they would import your .mdf file to their instance of Sql Server.
That saying, make sure you are working this out with your provider and following their instructions.
|
|
|
|
|
No, my provider is not able (or doesn't want) to read only a copy of my database.
They told me I must create a backup of my database. The best way in csv.
They (Provider) also provide a Internet tool which I can create a database new on their Server. But I guess I need first to create a script of my database to handle this.
But how? I tried to find a backup program in the internet. I found one but it doesn't work because a backup plugin in sql express is missing...
Question 1: What must I do and which tool I need (freeware) to create a backup?
Question 2: Is there a possibility to create a script which I can use for the provider's database import tool?
Chris
|
|
|
|
|
Hi Chris. Have you asked your provider how to do this? Many ASP.NET hosting companies I've seen have FAQ's or other documentation on how to copy data from a test database to a production one they host.
The easiest way to copy a complete database from test to production I can think of is to detach the sql server database from the test machine, copy the file to the production server, then attach the file within the production server environment. If that's not possible with your host, then maybe this will help:
http://support.microsoft.com/kb/241397/en-us[^]
|
|
|
|
|
I want to make a software which can create a SQL database from scratch with defined tables. (Difficult: Creating database)
Please give me coding of how to create a simple database with two/three tables and two/three columns (with full details as available in SQL Enterprise Manager >>> Table Design) in each table in VB.NET.
|
|
|
|
|
|
Thanx its what I wanted.
Thanx again.
Will you please tell me in between Access & SQL Server, which will you prefer.
And for both how you will deploy (make setup) your application.
|
|
|
|
|
Hi there. Access and SQL Server serve different purposes, and for their purposes, I like them both.
Access is a desktop database. For single-user, desktop application use, Access is terrific. With a properly indexed database, even complicated queries in Access are resolved quickly. Access' reporting tool is great and easy to use. Access is used a lot as a front-end with other database engines providing the back-end; for example, I have a Sql Server database for which I developed a front-end in Access to manage. Access can also be used well as an analytical tool, for analyzing data from a variety of sources - again, desktop-application use.
SQL Server is a client-server database engine, supporting multiple users in a much more robust way than the JET engine (the database engine behind Microsoft Access). As such, SQL Server is a better choice than Access as the back-end database for web applications. SQL Server, like most client-server RDBMS', supports transactions which are essential for many business applications.
If I am writing a .NET desktop application (WinForms), as a single-user application, and I know the end user has Microsoft Office licensed, I have no problems choosing JET for the back end database (even using Access to create the database... or even using Access as the application platform itself and not using .NET!). If I am writing multi-user applications or web applications... if I need more granular security (like protecting individual columns of a table)... if I want the power of stored procedures, triggers, transactions... these are all reasons to use SQL Server.
|
|
|
|
|
Great Explaination!
Thanx I learn a lot from your explanation.
I want to develop a single user application & am switching to Access. Thanx again for helping me choosing either Access or SQL Server.
GoodBye
|
|
|
|
|
Hi all!
I am trying to convert a program from 4G database managemet software(TAS 5.1). The database design in that environment allowed you to have arrays as fields. To give you more detail, I am converting the timesheet application we have to sql/c#. In the former, I had one key for the employee ID and 7 arrays for each date/time in/time out/lunch break/vacation/ and total hours, for each day of the week. Now, I am trying to build this in sql. But sql does not allow colums that are arrays(?) Am I correct there?
If so, what would be a better database design? One table with columns for each day of the week, or a table for employees that has a relation ship to tables for each day of the week?
Thanx on advance!
|
|
|
|
|
Well, for good relational design, a good rule of thumb is to have separate tables for different subjects of data. An "Employee" is one subject, so you would have a table "Employees", and in that table an "EmployeeID" field that uniquely identifies any given record.
What is the other subject of data you are dealing with here? Is "TimeCard" the subject? Would "TimeCardEntry" be still another subject?
Maybe "TimeCard" would have fields like "TimeCardID", "EmployeeID" (to associate a single time card to a single employee), "SubmittedOn", "ApprovedBy", that sort of thing. Perhaps "TimeCardEntry" would have fields like "TimeCardID" (to associate back to a single time card), "StartingWorkDateTime", "EndingWorkDateTime", etc...
The display of data out of this kind of relational structure would then involve queries that join the three tables.
|
|
|
|
|
OK, think I got the idea and will restructure the database after I get over this roadblock.
I am gettng the following error when processing an insert command on the database:
The name 'intEmployeeID' is not permitted in this context. Only constants, expressions, or variables are allowed here. Column names ar not permitted
Fixed that part - Now I am trying to store just the time in the table in a column that is defined as a smalldatetime. What I am trying to insert is the DateTime.Now.(Something)..I looked up the definition for this and it has a lot of variables, but not one for just time...is there another struct, function, or collection I should be using?
Thanx in advance!
-- modified at 16:34 Wednesday 8th February, 2006
|
|
|
|
|
Hi there. Unfortunately, there isn't a field type for just a Time value in Sql Server. You could go ahead and store the time with a date in a smalldatetime or datetime field, or you could create a varchar field and store the time as a string.
|
|
|
|
|
Thanx for the quick reply!
I have tried using the DateTime.Now property but I get an error stating "Incorrect syntax near '4'" in a try/catch block. What the DateTime.Now is producing is 2/8/2006 4:26:08 PM, so I am guessing it is a space problem ( between the Date and Time ). How can I resolve this?
Thanx!
Jude
|
|
|
|
|
Hey, Jude. Don't make it bad. Take a sad song and make it better.
(sorry - couldn't resist)
Okay - now I'm guessing you're not using parameterized queries for your Insert statement. Using parameterized queries is a good thing. Not using them is a bad thing. Can you show the code snippet that is causing the error and I can confirm (or reject) this suspicion?
|
|
|
|
|
you are correct...let me change the the code...if it doesn't work then I'll post a snippet.
Thanx!
|
|
|
|
|
But when you change it, please do consider using real parameters... it is a big help to prevent
SQL injection attacks[^].
|
|
|
|
|
In other words, create a stored procedure with parameters?
|
|
|
|
|
That would be one way. Or you could use a regular insert statement with parameters. If you're using Sql Server for example, your CommandText could look like this:
INSERT INTO MyTable
(Column1, Column2, Column3)
Values
(@val1, @val2, @val3) In this example, @val1 , @val2 , and @val3 would be the parameters. Then you add SqlParameter objects to your SqlCommand 's Parameters collection (I like using the method AddWithValue like this psudo-code:
SqlCommand cmd = new SqlCommand(...);
cmd.CommandText = "INSERT INTO...";
cmd.Parameters.AddWithValue("@val1","theValue");
cmd.Parameters.AddWithValue("@val2",intOtherValue);
cmd.Parameters.AddWithValue("@val3",dateTimeThirdValue);
|
|
|
|
|
Ok...had to vpn to the office and grab the code and database.
Heres what I have in C# Code
SqlCommand cmdUpdateTime = new SqlCommand("SetTime",conn);
cmdUpdateTime.Parameters.Add("@EmpNumber",SqlDbType.Int).Value = m_intEmployeeID;
cmdUpdateTime.Parameters.Add("@TimeIn",SqlDbType.SmallDateTime).Value = DateTime.Now;
switch(DateTime.Now.DayOfWeek)
{
case DayOfWeek.Wednesday:
cmdUpdateTime.ExecuteNonQuery();
break;
}
conn.Close();
}
catch (SqlException caught)
{
MessageBox.Show(caught.Message,"Error");
}
and here is the Stored Procedure:
ALTER PROCEDURE dbo.SetTime
(
@EmpNumber int,
@TimeIn smalldatetime
)
AS
INSERT INTO Emptime(EmpID,WedIn)
VALUES(@EmpNumber,@TimeIn)
RETURN
What I am getting nw is the error:
Incorrect syntax near "SetTime"
???
Thanx for all your help!
|
|
|
|
|
Try setting the CommandType of your SqlCommand object to CommandType.StoredProcedure .
|
|
|
|