Click here to Skip to main content
15,901,205 members
Home / Discussions / Database
   

Database

 
Questionurgent help needed Pin
Naveed Kamboh25-May-06 0:53
Naveed Kamboh25-May-06 0:53 
AnswerRe: urgent help needed Pin
Michael P Butler25-May-06 4:28
Michael P Butler25-May-06 4:28 
Questionlimitation of columns in sql table Pin
bita_engr24-May-06 21:52
bita_engr24-May-06 21:52 
AnswerRe: limitation of columns in sql table Pin
sathish s24-May-06 22:16
sathish s24-May-06 22:16 
Questionhelp me ! to Insert a record Pin
himuskanhere24-May-06 21:32
himuskanhere24-May-06 21:32 
Questioni need to make backup using C# Pin
ahmed shawky24-May-06 21:16
ahmed shawky24-May-06 21:16 
AnswerRe: i need to make backup using C# Pin
Colin Angus Mackay25-May-06 9:51
Colin Angus Mackay25-May-06 9:51 
QuestionQuery Selection With a Collection of values Pin
NICE TO MEET24-May-06 18:58
NICE TO MEET24-May-06 18:58 
SELECT InventoryID,InventorySubTypeID,Make,Model,SerialNumber,OriginalCost,NetValue,InventoryStatusID, isnull(null ,0) [Adjustment Amount],isnull(null ,0) [New Net Value] ,null [Change Status To],null [Comments] from Inventory_Profile where InventoryID in (inventoryIds)

this scenario the inventoryids is a collection of ids like below

SELECT InventoryID,InventorySubTypeID,Make,Model,SerialNumber,OriginalCost,NetValue,InventoryStatusID, isnull(null ,0) [Adjustment Amount],isnull(null ,0) [New Net Value] ,null [Change Status To],null [Comments] from Inventory_Profile where InventoryID in (1,2,3,4,5)


the above query want to take 5 rows from DB


this scenario i want to pass the ids at run time as a string in C#



Also how will i take the string in the DA class(C#) to execute it



guide me please





This method is in DA class


public DataSet SelectAssetStatusValueAdjustmentList(string lessorName,string inventoryIds)
{

string SqlCommand = "SELECT InventoryID,InventorySubTypeID,Make,Model,SerialNumber,OriginalCost,NetValue,InventoryStatusID from Inventory_Profile where InventoryID in (@InventoryIDs)";


Database DB = DatabaseFactory.CreateDatabase(lessorName);
DbCommand DbCmd = DB.GetSqlStringCommand(SqlCommand);
DB.AddInParameter(DbCmd, "InventoryIDs", DbType.String, inventoryIds);

DB.LoadDataSet(DbCmd, InventoryIdList,"TABLE");
return InventoryIdList;
}



While i pass the inventoryIds as a string of
collection 1,2,3,4,5...



This time the DA Class addinparameter is defined as string DbType.String


how will the query will take as collection of numbers or as a string while execution



-

AnswerRe: Query Selection With a Collection of values Pin
Luis Alonso Ramos24-May-06 19:57
Luis Alonso Ramos24-May-06 19:57 
Questionhow to insert data to table using ADO Pin
himuskanhere24-May-06 18:33
himuskanhere24-May-06 18:33 
QuestionChallenging DB Quest. (Tree-Node) Pin
Eliee24-May-06 15:58
Eliee24-May-06 15:58 
AnswerRe: Challenging DB Quest. (Tree-Node) Pin
Dinuj Nath24-May-06 20:50
Dinuj Nath24-May-06 20:50 
QuestionRe: Challenging DB Quest. (Tree-Node) Pin
mr_1234525-May-06 4:37
mr_1234525-May-06 4:37 
AnswerRe: Challenging DB Quest. (Tree-Node) Pin
Dinuj Nath25-May-06 19:04
Dinuj Nath25-May-06 19:04 
GeneralRe: Challenging DB Quest. (Tree-Node) Pin
Eliee25-May-06 9:21
Eliee25-May-06 9:21 
GeneralRe: Challenging DB Quest. (Tree-Node) Pin
Dinuj Nath25-May-06 19:07
Dinuj Nath25-May-06 19:07 
QuestionRestoring a BAK file (created suing SQL Server 2000) in SQL Server 2005 Pin
spirit_kleptus24-May-06 7:27
spirit_kleptus24-May-06 7:27 
QuestionConnectionString Changes during Runtime? Pin
DEWright_CA24-May-06 5:38
DEWright_CA24-May-06 5:38 
Questionreturning a user group in MS Access Pin
achrafus24-May-06 4:07
achrafus24-May-06 4:07 
QuestionInserting lots of rows programmatically Pin
AnneThorne24-May-06 2:59
AnneThorne24-May-06 2:59 
AnswerRe: Inserting lots of rows programmatically Pin
john.nada24-May-06 5:33
john.nada24-May-06 5:33 
GeneralRe: Inserting lots of rows programmatically Pin
AnneThorne24-May-06 8:59
AnneThorne24-May-06 8:59 
GeneralRe: Inserting lots of rows programmatically Pin
Eric Dahlvang24-May-06 11:59
Eric Dahlvang24-May-06 11:59 
GeneralRe: Inserting lots of rows programmatically Pin
john.nada24-May-06 12:07
john.nada24-May-06 12:07 
QuestionODP.NET vs System.Data.OracleClient Pin
CooperWu24-May-06 0:11
CooperWu24-May-06 0:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.