Click here to Skip to main content
15,908,843 members
Home / Discussions / C#
   

C#

 
AnswerRe: help with inport csv file to my C# program Pin
_Erik_15-Dec-10 4:29
_Erik_15-Dec-10 4:29 
NewsMessage Removed Pin
14-Dec-10 23:59
professionalPranay Rana14-Dec-10 23:59 
GeneralRe: Learn SQL to LINQ ( Visual Representation ) Pin
Hiren solanki15-Dec-10 0:03
Hiren solanki15-Dec-10 0:03 
GeneralRe: Learn SQL to LINQ ( Visual Representation ) Pin
Pranay Rana15-Dec-10 0:42
professionalPranay Rana15-Dec-10 0:42 
GeneralRe: Learn SQL to LINQ ( Visual Representation ) Pin
thatraja15-Dec-10 0:29
professionalthatraja15-Dec-10 0:29 
GeneralRe: Learn SQL to LINQ ( Visual Representation ) Pin
Pranay Rana15-Dec-10 0:42
professionalPranay Rana15-Dec-10 0:42 
GeneralRe: Learn SQL to LINQ ( Visual Representation ) Pin
Pete O'Hanlon15-Dec-10 0:45
mvePete O'Hanlon15-Dec-10 0:45 
QuestionBulk insert data Pin
anishkannan14-Dec-10 18:31
anishkannan14-Dec-10 18:31 
AnswerRe: Bulk insert data Pin
Abhinav S14-Dec-10 18:39
Abhinav S14-Dec-10 18:39 
AnswerRe: Bulk insert data Pin
RaviRanjanKr14-Dec-10 18:51
professionalRaviRanjanKr14-Dec-10 18:51 
GeneralRe: Bulk insert data Pin
anishkannan14-Dec-10 19:18
anishkannan14-Dec-10 19:18 
Questionhow to capture the event when the monitor close [modified] Pin
scoket14-Dec-10 15:49
scoket14-Dec-10 15:49 
AnswerRe: how to capture the event when the monitor close Pin
Hiren solanki14-Dec-10 19:35
Hiren solanki14-Dec-10 19:35 
GeneralRe: how to capture the event when the monitor close Pin
scoket14-Dec-10 20:35
scoket14-Dec-10 20:35 
GeneralRe: how to capture the event when the monitor close Pin
Dave Kreskowiak15-Dec-10 2:09
mveDave Kreskowiak15-Dec-10 2:09 
GeneralRe: how to capture the event when the monitor close Pin
scoket15-Dec-10 15:00
scoket15-Dec-10 15:00 
GeneralRe: how to capture the event when the monitor close Pin
Dave Kreskowiak15-Dec-10 16:18
mveDave Kreskowiak15-Dec-10 16:18 
AnswerRe: how to capture the event when the monitor close Pin
Pete O'Hanlon15-Dec-10 2:54
mvePete O'Hanlon15-Dec-10 2:54 
Questionarray [modified] Pin
jim haras14-Dec-10 15:33
jim haras14-Dec-10 15:33 
hi there. i am creating a bookstore web service for my course project. the part i find difficult, is to implement the search-for-books part of the web service into the web site i am building. with a little help a created the web method for that. it returns an array which includes the information of the book using the book id as input. i want to display the info in my website either with a gridview or a data list or even with textboxes. this is the method. any help would be greatly appreciated Big Grin | :-D Big Grin | :-D Big Grin | :-D

[WebMethod]
public BooksClass.Books GetBookInfo(string Book_ID)
{
BooksClass.Books books = new BooksClass.Books();
SqlConnection SQLConn = new SqlConnection();
string strSQL = "SELECT * FROM Books WHERE Book_ID = '" + Book_ID + "' ";
SqlDataReader Reader = null;
try
{
SQLConn.ConnectionString = @"Data Source = .\SQLEXPRESS; AttachDbFilename = C:\Users\jimis\Desktop\BookstoreBrokerWebService\BookstoreBrokerWebService\App_Data\BookstoreBrokerDatabase.mdf;
Integrated Security = True; User Instance = True;";

SQLConn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = SQLConn;
cmd.CommandText = strSQL;

Reader = cmd.ExecuteReader();

while (Reader.Read())
{
books.book_ID = Reader[0].ToString();
books.title = Reader[1].ToString();
books.author = Reader[2].ToString();
books.publisher = Reader[3].ToString();
books.category = Reader[4].ToString();
books.year = Reader[5].ToString();
books.edition = Reader[6].ToString();
books.isbn = Reader[7].ToString();
books.price = Reader[8].ToString();
books.number_of_Copies = Reader[9].ToString();

}

}
finally
{
if (Reader != null)
{
Reader.Close();
}
if (SQLConn != null)
{
SQLConn.Close();
}

}

return books;


}

modified on Wednesday, December 15, 2010 11:40 AM

AnswerRe: array Pin
PIEBALDconsult14-Dec-10 18:09
mvePIEBALDconsult14-Dec-10 18:09 
AnswerRe: array Pin
Abhinav S14-Dec-10 18:47
Abhinav S14-Dec-10 18:47 
AnswerRe: array Pin
Hiren solanki14-Dec-10 19:42
Hiren solanki14-Dec-10 19:42 
GeneralRe: array Pin
jim haras15-Dec-10 5:47
jim haras15-Dec-10 5:47 
GeneralRe: array Pin
jim haras16-Dec-10 16:05
jim haras16-Dec-10 16:05 
QuestionAction keyword question Pin
SciGama14-Dec-10 11:24
SciGama14-Dec-10 11:24 

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.