Click here to Skip to main content
15,921,837 members
Home / Discussions / C#
   

C#

 
GeneralHeh, doesn't work Pin
Ennis Ray Lynch, Jr.7-Jul-06 8:23
Ennis Ray Lynch, Jr.7-Jul-06 8:23 
AnswerRe: Heh, doesn't work Pin
Guffa7-Jul-06 23:45
Guffa7-Jul-06 23:45 
QuestionRichTextBoxControl cursor position Pin
Radu Sorin7-Jul-06 0:16
Radu Sorin7-Jul-06 0:16 
AnswerRe: RichTextBoxControl cursor position Pin
mav.northwind7-Jul-06 1:07
mav.northwind7-Jul-06 1:07 
AnswerRe: RichTextBoxControl cursor position Pin
BoneSoft7-Jul-06 3:48
BoneSoft7-Jul-06 3:48 
QuestionData Access Application Block AddInParameter method Pin
Brendan Vogt7-Jul-06 0:12
Brendan Vogt7-Jul-06 0:12 
AnswerRe: Data Access Application Block AddInParameter method Pin
Not Active7-Jul-06 2:56
mentorNot Active7-Jul-06 2:56 
QuestionData Access Application Block Pin
Brendan Vogt7-Jul-06 0:04
Brendan Vogt7-Jul-06 0:04 
Hi,

I am using the data access application block January 2006. It's the first time that I am using it. Can someone please look at my code and comment on it, I want to know if I am doing this correctly, and if there is anything I need to add or to close/dispose. Am I checking for the correct exceptions? Basically I want to return a strongly typed list of Vendor objects:

public static List<Vendor> GetAllVendors()
{
DbCommand dbCommand = null;
List<Vendor> vendorList = new List<Vendor>();

try
{
// Load the default database
Database db = DatabaseHelper.DatabaseDB;

// Specify the stored procedure
string strSProc = "sp_Vendor_GetAllVendors";

using (dbCommand = db.GetStoredProcCommand(strSProc))
{
IDataReader rdr = db.ExecuteReader(dbCommand);

while (rdr.Read())
{
Vendor objVendor = new Vendor();
objVendor.ID = DatabaseHelper.GetInt(rdr["VendorID_PK"]);
objVendor.Status = DatabaseHelper.GetBool(rdr["VendorStatus"]);
// Add Vendor instance to array
vendorList.Add(objVendor);
}
rdr.Close();
}
}
catch (SqlException ex)
{
throw new Exception(ex.Message, ex);
}
finally
{
dbCommand.Dispose();
}

return vendorList;
}


Hope someone can let me know!

Regards,
ma se
AnswerRe: Data Access Application Block Pin
Not Active7-Jul-06 2:49
mentorNot Active7-Jul-06 2:49 
QuestionWebbrowser control - opening link in new window Pin
Oohmesh6-Jul-06 23:59
Oohmesh6-Jul-06 23:59 
AnswerRe: Webbrowser control - opening link in new window Pin
Anh_Tuan7-Jul-06 1:34
Anh_Tuan7-Jul-06 1:34 
GeneralRe: Webbrowser control - opening link in new window Pin
Jax_qqq12-Jul-06 5:27
Jax_qqq12-Jul-06 5:27 
GeneralRe: Webbrowser control - opening link in new window Pin
Anh_Tuan12-Jul-06 18:10
Anh_Tuan12-Jul-06 18:10 
QuestionWant code to Extract Table of content from a pdf file [modified] Pin
Prathi.V6-Jul-06 23:31
Prathi.V6-Jul-06 23:31 
QuestionCrystal Reports - Runtime Pin
SysJey6-Jul-06 23:00
SysJey6-Jul-06 23:00 
QuestionFOP it Pin
Support1236-Jul-06 23:00
Support1236-Jul-06 23:00 
QuestionHow to find the Server IP using .net Pin
rajkasa6-Jul-06 22:38
rajkasa6-Jul-06 22:38 
AnswerRe: How to find the Server IP using .net Pin
stancrm6-Jul-06 22:49
stancrm6-Jul-06 22:49 
Questionstring problem ? help please ¿ Pin
cmpeng346-Jul-06 22:37
cmpeng346-Jul-06 22:37 
AnswerRe: string problem ? help please ¿ Pin
stancrm6-Jul-06 22:58
stancrm6-Jul-06 22:58 
AnswerRe: string problem ? help please ¿ Pin
Guffa6-Jul-06 22:59
Guffa6-Jul-06 22:59 
AnswerRe: string problem ? help please ¿ Pin
Nader Elshehabi6-Jul-06 23:15
Nader Elshehabi6-Jul-06 23:15 
GeneralRe: string problem ? help please ¿ Pin
Anh_Tuan7-Jul-06 2:18
Anh_Tuan7-Jul-06 2:18 
AnswerRe: string problem ? help please ¿ Pin
V.7-Jul-06 1:10
professionalV.7-Jul-06 1:10 
Questioninstance of a crystal report Pin
cellardoor07166-Jul-06 22:25
cellardoor07166-Jul-06 22:25 

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.