Need Suggestion
Apr 8, 2008
Hello,
I will have to create a table that consists of only of two main fields. one: them employeeID and two: the SupervisorID,
my question is what should I define as my primary key. Should it be an aditional field, or could it be the EmployeeID field.
The employeeID is an unique filed. The end user for this application will be updating rearly some of this records, and may be adding or deleting some new records exporadically.
Thanks for suggestions.
View 3 Replies
ADVERTISEMENT
Nov 4, 1999
I have a table it contians 3735300 rows. and 5 col
Everyday more than 200000 rows will be inserted
When I run a query to extract a week data from the above table It is taking more than 2hrs.
The table has clustered index on all the 4 col.
Can anyone suggest me how to improve the performance.
Thanks in advence.
sqlranga@yahoo.com
View 1 Replies
View Related
Aug 27, 2006
hi.. guys
one of my table has more than 300million rows. that i need to remove the data b4 may 2006 which is over 250 million rows. since the insert rate so high(none stop) and i cant truncate the whole table and dump the data after may 2006 back in (they wont let me). and if i use delete statment to delete only 200k rows data it will freeze up the whole database for long time(around 45 mins) and it will take me few months i believe. so that's not the option either.
is anyone out there got better idea?
also i got another table has more than 150 millions rows that index need to rebuild .... anyone got any idea how long it gonna take? just roughly guess. thanks
View 2 Replies
View Related
May 20, 2008
Dear all
I am using sql server 2005 , asp.net 2.0 ,C#.
I need some suggesstion on how to pass request info to new level . that is if a employee request for something mail should go its next level ie. immidiate boss(next level can be null) and at any time requested or chain of employee( immidiate boss and succesor ).
Please suggest something
View 1 Replies
View Related
Jun 24, 2006
Hi,
We are plan to develop a new VB6 / MS Access application that will produce a whole bundle of reports for the outside salesman team (all of them have a laptop). The data is come from midrange AS400 tables.
Now we have decided should we using SQL Express with SQL tables or just MS Access MDB tables. Some of the laptop the salesman is only P3-800 and I'm worry about the speed for SQL express on those laptop.
The other hand, I like to use SQL databases, since we have the SQL server 2005 running for other application already.
Any one tested the performance between the SQL Express via MS MDB, it seems the SQL 2005 express is use more overhead than MSDE.
We tried the MSDE and the performance is not that great after the database grow beyond 500MB .
Any suggestion are welcome.
Thnaks!
View 4 Replies
View Related
Jul 23, 2005
Hey guysI have to implement a dynamic Parent - > Child Scenario ... but the catch isas Follows :I need to create this Table Design so that I can have multiple Parent ->child - > parent Relationships(ie Db driven "Window Explorer - feel". 1 Folder that holds another Folderthat holds another Folder etc to Infinite )So if the Above makes any sense ... Suggestions would be WelcomeThanx
View 3 Replies
View Related
Nov 23, 2005
Hi,I've 2 Databases one is online and one is offline (connected toInternet).. using SQL SERVER for both servers, i need to update theOFFLINE Database one on a time schedule for every 15 mins from theOnline DATABASE.. can anybody suggest a better way other than web services.. coz ourserver is quite old and doesn't support webservices..any ideas.--chavasreedharMessage posted via http://www.exforsys.com for all your training needs.
View 1 Replies
View Related
Mar 14, 2008
All,
I need to keep checking (every 30 minutes) for a record in a table to appear,
Any idea on how to do it? Should it be done in a SSIS package or in sql server job schedule?
Please give more detail on to accomplish.
Thanks in advance
View 6 Replies
View Related
Aug 27, 2007
We have SQL server 2005 as backend in our portal project.We have job search interface with below searchable fields
1.) City
2.)State --length 2
3.)Zip-- 5
4.)Keywords ( space or comma delimeted words)
5.)Category (Drop down List)
6.)Subcategory (Drop down List)
Based on the above fields we have 2 options to search and avoid performance related issues.
1.) concatenate all the above 6 columns into 1 column and apply a full text search. Fields like state & Zip will be appended with some delimeter to do a search on those particular values .
Ex : store the state "CA" as '#stCA#'. so that it will not search the rest of the data that has keyword CA.
2.) create a table with the above 6 columns and create a Full-Text search on all the columns.
Can you suggest us which one will best and why? If not any alternate better solution
View 1 Replies
View Related
May 27, 2008
I have a table that allows the scheduling of devices.
I can create an Insert Statement that allows a user to schedule a device as follows:
Device #1 From 5/1/08 To 5/30/08
Is there away to create a check that prevents the user from scheduling that SAME device for any days within that month?
Device #1 is NOT available to be scheduled anytime during the month of May because it is already scheduled.
Thanks for any suggestion.
Wayne
View 10 Replies
View Related
Jun 24, 2004
Hi
I have a few tables which store classinfo, testsinfo, scoresinfo respectively.
For a given classID/TestID/CourseID i need to be able get the top 5/10/15 etc, avg, max, min of scores for reporting purposes.
I am wondering if i should maintain a seperate table which would be populated by a job daily and which would maintain the topper IDs rather than having a Stored proc return them dynamically when needed. I am looking for some suggestions. Please let me know.
Thanks.
View 1 Replies
View Related
May 3, 2006
I have some problem with ASP.NET cache, I found other people has similar problem, but I didn't find real solution.
The one bother me most is the SQLCacheDependency doesn't work stable. I insert object in cache and has SQLCacheDependency linked. After a period of time, it stopped working. That means the the object is still in cache, but change on db side doesn't remove the cache entry. I am not sure if it is ASP side or SQL side, I feel it is ASP side.
I am using 2.0 + SQL 2005.
Once the db command notification stop working, you have to restart IIS or clear all items in cache since you don't kno which one is changed.
Any suggestion?
View 12 Replies
View Related
Oct 18, 2006
My primary data files are ponting to F drive which is 200G and one db has occupied 90% of the space and the applications are not running. What is the best solution
View 1 Replies
View Related
Oct 21, 2007
Hai, This posting related to my previous posting. Updating Bulk record. Actully im writing SP for windows Services, which does bulk updating of records to Sql 2000.
In one point of time, i may recieve 2000 records for single update..So what i have done, im concatinating the values to be updated in string and passing the string..
But when i did the calcuation for 2000 records, the length of the character comes around 10000. So i cannot user Varchar to hold me concatinated value in SP. There is another datatype "Text" but im not sure abt that. For my requirment what is the data type can i go for.. if i can use "Text" how to declare that...Ordinary declaration gives me error..
Help pls
View 3 Replies
View Related
Oct 24, 2007
Hai, i need ur suggestion to use ntext in my table. basically i want to store the xml data(will be in same xml format only) in sql2000 database. the max size of the data will be 5mb.
so can i use ntext to store this data.basically, only once i insert the data to the database. no update after that. only i throw the query to retrieve that xml data from the database. is it advisable to use,ntext for this requirment. is there any other suggestion ??
help pls
View 2 Replies
View Related
Apr 16, 2007
Can anyone recommend good books for learning Reporting Services? Assume the reader is familiar with Crystal Reports and other reporting environments, but has no experience with SQL Server 2005 and very little with Visual Studio 2005.
View 1 Replies
View Related
Aug 18, 2007
Hi Friends
I required a suggestion from your side
Actually I am working in MS Access from last 6 months. Now I want to convert my database into SQL Server
I have a knowledge of SQL Server and I don't have any problem with this.
But what I want to know how to maintain a report in SQL Server I don't have any knowledge for creating a report. My freinds suggest me a Visual Studio 2005 for creating a Crystal Report.
So Please suggest me it is helpful or not and onething more is that I have to work on SQL Server 2000 or SQL Server 2005 which is more beneficial.
Please reply me for this
Waiting for your any kind of reply
Please
Thanks
Ashish
View 2 Replies
View Related
Mar 25, 2008
Hi,
I have push scripts using transcation replication . can i use some task of SSIS to automate the process .
Thanks,
Nav
View 5 Replies
View Related
Nov 13, 2007
Hi
I am new to Sql Server
I have to select all fields from a table based on min(date) . i have duplicate accountnumbers in the query i need to eliminate that based on min(dateTime).
when i am writing a query
Select a,b,c,min(d) from table , it is not working?
Below is the example
A B C D
222 1 11 2007-02-12 14:09:16.000
222 1 8 2007-11-06 13:57:18.480
Any suggestions would be very helpful
View 3 Replies
View Related
Dec 12, 2006
I am transfering data from a textfile to sql server.I use a data flow task for trasfering my text files.
Here is what i do.
1.Add text file source
What i want to achieve here is if the text file countains the column name in the first row i should delete them and if it does not contain column name in the first row just transfer it.
how can this be achieved???
2.add one more column to my text file which should contain the status(insert or update).
how can this be done??
3.before transfering data ot destination i want to know if the record exists if exists i just want to update it instead of insert.and if new record i want to insert it .and the status in the above new column need to change.
please help...
View 5 Replies
View Related
Aug 28, 2006
Hi guys,
I would like to be advised from experts on one career related question.
I have 5 + years of Experience as a DEV and Test.
I had mostly worked on VB6, .NET 1.1[ asp.net ,C#] for 3 years as DEV and since 2 years i am into Software System testing [ its more related to Functionality Testing of applications built using .NET [ asp.net/c#, Sql server 2005 ].
I would like to switch the career to Core Development again and would like to seek experts's adivice..
Iam interested in learning SQL Server 2005 advanced features[ BI]:
Could you pls suggest me one area in SQL server 2005 from below[ parameters:I should be able to learn it quickly on my own,great demand in the market , great scope for development in near fure etc.,] :
1) SSIS
2) Analysis Services
3) Reporting Services etc.,
or any other suggestions are welcome..I appreciate your time responding to this thread.
thanks!
View 5 Replies
View Related
May 11, 2008
Dear all,,
I used a program that convert from powerpoint to flash
the output of this program is a folder that contain 2 folders and a HTML page
How can I store those in my database?
note: I have to use all of these folders to preview the flash
Thanks in advance
View 5 Replies
View Related
Mar 26, 2006
I have noticed that the area of writing stored procedures for muti-user databases is a very specialised field and requires knowledge that's much more than the locking topics covered in 'online books' . I am sure there are some standard tips and tricks that are used in mutil-user databases for writing to tables. Most books have a chapter or two on locking, but I think this topic should be dealt with separately in a dedicated book to locking with extensive examples on locking. Does anyone know of such a dedicated book out there?
View 1 Replies
View Related
Nov 17, 2004
This is what I have:
Code:
Select
PR.WBS1,
PR.WBS2,
PR.WBS3,
PR.LongName,
PR.Name,
CL.Name as CLIENTNAME,
CFGMain.FirmName,
CFGMain.Address1,
CFGMain.Address2,
CFGMain.Address3,
CFGMain.Address4,
Contacts.FirstName + ' ' + Contacts.LastName as CONTACT,
isnull(LB.AmtBud, '0.00') as AmtBud,
Sum(LD.BillExt) as BillExt
From PR
left join Contacts ON PR.ContactID = Contacts.ContactID
left join CL ON CL.ClientID = PR.ClientID
left join LB ON LB.WBS1 = PR.WBS1 AND PR.WBS2 = LB.WBS2 AND LB.WBS3 = PR.WBS3
left join LD ON LD.WBS1 = PR.WBS1 AND PR.WBS2 = LD.WBS2 AND LD.WBS3 = PR.WBS3 And LD.BilledPeriod = '200408',
CFGMain
Where (PR.WBS3 <> 'ZZZ') and (PR.WBS2 <> 'ZZZ')
Group By PR.WBS1, PR.WBS2, PR.WBS3, PR.LongName, PR.Name, CL.Name, CFGMain.FirmName,
CFGMain.Address1, CFGMain.Address2, CFGMain.Address3,
CFGMain.Address4, Contacts.FirstName, Contacts.LastName,
LB.AmtBud
Right now I have a column that takes the sum of LD.BilledPeriod when equaled to '200408'. The problem is that I need to include another column that also calculates the sum for BillExt where LD.BilledPeriod <= '200408'. Ordinarily I would have done a subquery which I have tested and it does work. But, I have to find another way of doing this because when I add subqueries other functionality in the software I using does not work. So, I am hoping that someone might know another route for me to take. I was thinking about using a UNION but this will not create a new column that I need.
Thank You,
Laura
View 1 Replies
View Related
Nov 17, 2004
This is what I have:
Select
PR.WBS1,
PR.WBS2,
PR.WBS3,
PR.LongName,
PR.Name,
CL.Name as CLIENTNAME,
CFGMain.FirmName,
CFGMain.Address1,
CFGMain.Address2,
CFGMain.Address3,
CFGMain.Address4,
Contacts.FirstName + ' ' + Contacts.LastName as CONTACT,
isnull(LB.AmtBud, '0.00') as AmtBud,
Sum(LD.BillExt) as BillExt
From PR
left join Contacts ON PR.ContactID = Contacts.ContactID
left join CL ON CL.ClientID = PR.ClientID
left join LB ON LB.WBS1 = PR.WBS1 AND PR.WBS2 = LB.WBS2 AND LB.WBS3 = PR.WBS3
left join LD ON LD.WBS1 = PR.WBS1 AND PR.WBS2 = LD.WBS2 AND LD.WBS3 = PR.WBS3 And LD.BilledPeriod = '200408',
CFGMain
Where (PR.WBS3 <> 'ZZZ') and (PR.WBS2 <> 'ZZZ')
Group By PR.WBS1, PR.WBS2, PR.WBS3, PR.LongName, PR.Name, CL.Name, CFGMain.FirmName,
CFGMain.Address1, CFGMain.Address2, CFGMain.Address3,
CFGMain.Address4, Contacts.FirstName, Contacts.LastName,
LB.AmtBud
Right now I have a column that takes the sum of LD.BilledPeriod when equaled to '200408'. The problem is that I need to include another column that also calculates the sum for BillExt where LD.BilledPeriod <= '200408'. Ordinarily I would have done a subquery which I have tested and it does work. But, I have to find another way of doing this because when I add subqueries other functionality in the software I using does not work. So, I am hoping that someone might know another route for me to take. I was thinking about using a UNION but this will not create a new column that I need.
Thank You,
Laura
View 4 Replies
View Related
Dec 7, 2004
SELECT WBS2, (SUM(CASE WHEN wbs2 = '9001' THEN amount * - 1 END)) AS reimb
FROM LedgerAR
WHERE (WBS1 = '001-298') AND (WBS2 <> 'zzz') AND (WBS3 <> 'zzz') AND transtype = 'in'
GROUP BY wbs2
this is what the output looks like:
wbs2 amount
01410
12170
12180
12190
12220
12230
90013271.02
Id there a way to specify where I want this exact amount to display without having to a subquery. I would ideally like to take the 3271.02 and put it where wbs2 = '1217'
Any suggestions?
Thank You.
View 1 Replies
View Related
Jan 27, 2005
Hi Everyone,
I'm looking for some suggestions on how I can go about the following task. I have an application which connects to our SQL2000 servers. Ocasionally some of the db connections take a long time to run. What I'd like to do is enable some sort of logging which would provide me with the following pieces of information... where the request originated from, length of time servicing the request, some sort of info on the nature of the request (search, insert, update, sproc, etc...), time of the request.
I'd then like to cross reference these logs with my application logs to isolate which requests are taking to long to service. Hopefully this will help us as we attempt to eliminate the issue.
Thanks for any suggetions you might have!!!! much appreciated!
View 3 Replies
View Related
Aug 6, 2006
Please answer following questions?
1-Before installing microsoft cluster+SQL Virtual Server I should install normal installation of SQL2000 on both nodes.
2-I have 8x72 GB Ultra320 SCSI in MSA1500 storagebox. What is your recommendation how should I make drives and which RAID system for quroum,DB (db is almost 5 to 10 GB), and T-Log should I use?
3-I have only one database instance, so still I should configure MSDTC or no need?
4- Can I use the same drive and cluster group for Quorum and MSDTC?
5-On windows 2003 when SQL virtual server will finish installation. Then the SQL SP4 I should install on one node or I have to install it one by one on all nodes of the cluster.I am using Active/Passive scenario.
Pls reply my questions.Then I will start my projetct.....
View 2 Replies
View Related
Aug 23, 2007
Hello sir
I just started working in SQL Server so please don't mind when my question is irritating please help me out for this
I have a table having a coloumns
Month-----------------Size----------------------Issue
April-07---------------750----------------------2676
April-07--------------1000--------------------1223
April-07--------------180---------------------3439
April-07--------------90---------------------23562
May-07---------------750----------------------254
May-07--------------375--------------------454
May-07--------------180---------------------454
May-07--------------90---------------------3434
Something like that it is just a example o my table I have data in Thousands
So know what I want to do is I want to add one more coloumn where i want to use if statment something like that
Issue_cases: IIf([size]=1000,[Issue]/9,IIf([size]=750,[Issue]/12,IIf([size]=375,[Issue]/24,IIf([size]=180,[Issue]/48,IIf([size]=90,[Issue]/100)))))
now you please tell me that for this what I have to do I have to create a view or procedure or anything else and how?
Please tell me
I thing I explain my question best
I required your help immediately
Thanks
Ever Smiling
Ashish
You Have to Loss Many Times to Win Single Time
View 6 Replies
View Related
Jul 20, 2005
I have a table contains huge rows of data. Performance issue raised. I amthinking archive some data so that the table will not be that big. The mostconvience way is move it to another table. The problem is: will this solvemy performance problem? or I need to move it to another database to reducethe database size?Regards,TrueNo
View 2 Replies
View Related
Aug 18, 2006
Hi all,
At our facility, we have a > 350 gigs database and the DB is breaking into 2 files. One file is our Image table with the size of 300 gigs. The other file contains all of the other tables. The image file is getting bigger and bigger everyday, I am worry that eventually when a data file getting too big it could lead into problem. - DB fragmentatio, hard to manage etc
My question is anyone has run into this problem, and how do you solve it?
I am open for any suggestion.
BTW: I am using SQL 2000.
Thanks in advance.
View 9 Replies
View Related
Jun 4, 2007
I'm implementing a brand new project that consists in a soft-realtime application that executes scheduled operations (tcp commands) stored on a SqlServer 2005 express db. DB and app are always on the same workstation. Let's say that the workload is about 40000 events per day, with periods of activity and more idle periods. The DB is filled by external applications that provides insert/update using ad-hoc sprocs and providing only the 'preedceding event'. The major performance problem I see is given by the fact that each time an event is inserted the sproc must rebuild all the scheduled times (I've build an optimization that uses service broker as to update asynchronously the scheduled times). The application does not requires any special calculation and is very lightweight... it only fetches the db and sends tcp commands. The only 'hard work' is to guarantee the exact time for sending the commands.
Now I have to design the required hardware and I expect some tip from you on how to proceed to build a test workload and how to translate it into 'minimum hardware specification'. Consider that safety is not importand since system are redundant in other ways.
My questions are
- Should I put OS, tempdb, database and logs each on a separate disk array ? My idea is to have a two-disk RAID0 for OS and logfiles, and a n-disk RAID0 for tempdb and appdb
- How to extimate the number of disks to have in the RAID ?
- Should I also consider processor ? I have the idea that processor is not very important while I should pay attention to bus and memory bottlenecks: so I've thought to use DDR2 RAM with a FSB of 1066 MHz and a single dual or quad core cpu, so discarding XEON multiprocessor systems that requires FBDIMM, that AFAIK are slower that DDR2.
- any other suggestion ?
View 5 Replies
View Related
Nov 30, 2006
using System;
namespace BaResearch.Data.msSql
{
interface ISqlDataObject
{
System.Data.SqlClient.SqlConnection Connection { get; }
string ConnectionString { get; set; }
}
}
___________________________________using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace BaResearch.Data.msSql
{
public class SqlDataObject : ISqlDataObject
{
private string _ConnectionString;
public SqlConnection Connection
{
get { return new SqlConnection(_ConnectionString); }
}
public string ConnectionString
{
get
{
return _ConnectionString;
}
set
{
_ConnectionString = value;
}
}
}
}
__________________________________using System;
namespace BaResearch.Data
{
interface IBid
{
string Client { get; set; }
string Contact { get; set; }
string Sponsor { get; set; }
string Priority { get; set; }
string BidStatus { get; set; }
}
}
_____________________________________________using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace BaResearch.Data.msSql
{
public class Bid : SqlDataObject, IBid
{
#region private member & variables
private int _BidID;
private string _DateCreated;
private string _CreatedBy;
private string _Client;
private string _Contact;
private string _Sponsor;
private string _Priority;
private string _BidStatus;
private SqlDataAdapter sqlda = new SqlDataAdapter();
private SqlCommand _command;
private SqlParameter[] _parameters =
{
new SqlParameter("@client",SqlDbType.NVarChar),
new SqlParameter("@contact",SqlDbType.NVarChar),
new SqlParameter("@sponsor",SqlDbType.NVarChar),
new SqlParameter("@priority",SqlDbType.NVarChar),
new SqlParameter("@bidstatus",SqlDbType.NVarChar),
};
#endregion
#region public member variables - stored procedures
//private string sp_Create = "bids_sp_insert";
//private string sp_Update_ByID = "bids_sp_updatebyid";
//private string sp_Delete_ByID = "bids_sp_deletebyid";
//private string sp_Select_All = "bids_sp_selectall";
//private string sp_Select_ByID = "bids_sp_selectbyid";
//private string sp_Select_ByValue = "bids_sp_selectbyvalue";
#endregion
#region constructors and destructors
public Bid()
{
if (this.ConnectionString == null)
{
this.ConnectionString = ConfigurationManager.ConnectionStrings["SQL.ConnectionString"].ConnectionString;
}
else
{
new Bid(this.ConnectionString);
}
}
public Bid(string ConnectionString)
{
this.ConnectionString = ConnectionString;
}
#endregion
#region methods & events
/// <summary>
/// Attach parameters to an SqlCommand
/// </summary>
/// <param name="sqlcmd">SqlCommand</param>
private void attachparameters(SqlCommand sqlcmd)
{
sqlcmd.Parameters.Clear();
foreach (SqlParameter param in _parameters)
{
sqlcmd.Parameters.Add(param);
}
}
/// <summary>
/// Assign value to the parameters
/// </summary>
/// <param name="sqlcmd">SqlCommand</param>
/// <param name="value">Client object</param>
private void assignparametervalues(SqlCommand sqlcmd, Bid value)
{
this.attachparameters(sqlcmd);
// todo: assign parameter values here
sqlcmd.Parameters[0].Value = value.Client;
sqlcmd.Parameters[1].Value = value.Contact;
sqlcmd.Parameters[2].Value = value.Sponsor;
sqlcmd.Parameters[3].Value = value.Priority;
sqlcmd.Parameters[4].Value = value.BidStatus;
}
public virtual void Create(Bid value)
{
_command = new SqlCommand();
_command.Connection = this.Connection;
_command.CommandText = @"INSERT INTO bids (client, contact, sponsor, priority, bidstatus, createdby)
VALUES (@client, @contact, @sponsor, @priority, @bidstatus, @createdby);";
_command.CommandType = CommandType.Text;
try
{
sqlda.InsertCommand = _command;
this.assignparametervalues(sqlda.InsertCommand, value);
sqlda.InsertCommand.Parameters.AddWithValue("@createdby", value.CreatedBy);
sqlda.InsertCommand.Parameters.Add("@bidid", SqlDbType.Int);
sqlda.InsertCommand.Parameters["@bidid"].Direction = ParameterDirection.ReturnValue;
sqlda.InsertCommand.Connection.Open();
sqlda.InsertCommand.ExecuteNonQuery();
sqlda.InsertCommand.Connection.Close();
sqlda.InsertCommand.Connection.Dispose();
}
catch (Exception e)
{
throw new Exception(e.Message);
}
}
public virtual int Update(Bid value)
{
int result;
_command = new SqlCommand();
_command.Connection = this.Connection;
_command.CommandText = @"UPDATE bids SET client=@client, contact=@contact, sponsor=@sponsor,
priority=@priority, bidstatus=@bidstatus
WHERE bidid=@bidid";
_command.CommandType = CommandType.Text;
try
{
sqlda.UpdateCommand = _command;
using (SqlCommand _cmd = sqlda.UpdateCommand)
{
this.assignparametervalues(_cmd, value);
_cmd.Parameters.AddWithValue("@bidid", value.BidID);
_cmd.Connection.Open();
result = _cmd.ExecuteNonQuery();
_cmd.Connection.Close();
_cmd.Connection.Dispose();
}
}
catch (Exception e)
{
throw new Exception(e.Message);
}
return result;
}
public virtual void Delete(Bid value)
{
_command = new SqlCommand();
_command.Connection = this.Connection;
_command.CommandText = @"DELETE bids WHERE bidid=@bidid;";
_command.CommandType = CommandType.Text;
try
{
sqlda.DeleteCommand = _command;
using (SqlCommand _cmd = sqlda.DeleteCommand)
{
_cmd.Parameters.AddWithValue("@bidid", value.BidID);
_cmd.Connection.Open();
_cmd.ExecuteNonQuery();
_cmd.Connection.Close();
_cmd.Connection.Dispose();
}
}
catch (Exception e)
{
throw new Exception(e.Message);
}
}
public virtual DataSet List(string filter)
{
DataSet result = new DataSet();
_command = new SqlCommand();
_command.Connection = this.Connection;
_command.CommandText = @"SELECT * FROM bids_view_listall
WHERE (clientname like @value) or (contactname like @value)
or (sponsor like @value) ORDER BY datecreated DESC";
_command.CommandType = CommandType.Text;
try
{
if (filter != null)
{
filter = filter.Replace(" ", "%");
}
sqlda.SelectCommand = _command;
sqlda.SelectCommand.Parameters.AddWithValue("@value", "%" + filter + "%");
sqlda.Fill(result);
}
catch (Exception e)
{
throw new Exception(e.Message);
}
return (DataSet)result;
}
#endregion
#region IBid Members
public string Client
{
get
{
return _Client;
}
set
{
_Client = value;
}
}
public string Contact
{
get
{
return _Contact;
}
set
{
_Contact = value;
}
}
public string Sponsor
{
get
{
return _Sponsor;
}
set
{
_Sponsor = value;
}
}
public string Priority
{
get
{
return _Priority;
}
set
{
_Priority = value;
}
}
public string BidStatus
{
get
{
return _BidStatus;
}
set
{
_BidStatus = value;
}
}
#endregion
#region Properties
public int BidID
{
get
{ return _BidID; }
set
{ _BidID = value; }
}
public string DateCreated
{
get
{
return _DateCreated;
}
set
{
_DateCreated = value;
}
}
public string CreatedBy
{
get
{
return _CreatedBy;
}
set
{
_CreatedBy = value;
}
}
#endregion
}
}
_____________________________________________
Am I on a right path? I will greatly appreciate in any comments or suggestions for a design. I am creating an n-tier application and i don't know if my design is right. I dont have the proper schooling for creating this kind of applications and I am still on layer of data access and business logic.
View 5 Replies
View Related