Click here to Skip to main content
15,890,690 members
Home / Discussions / C#
   

C#

 
GeneralRe: load a lot of Images to memory Pin
harold aptroot13-Jun-09 22:38
harold aptroot13-Jun-09 22:38 
GeneralRe: load a lot of Images to memory Pin
Guffa13-Jun-09 23:30
Guffa13-Jun-09 23:30 
GeneralRe: load a lot of Images to memory Pin
nryk14-Jun-09 0:16
nryk14-Jun-09 0:16 
GeneralRe: load a lot of Images to memory Pin
Guffa14-Jun-09 21:18
Guffa14-Jun-09 21:18 
QuestionDockPanel Suite Pin
Rafone13-Jun-09 6:24
Rafone13-Jun-09 6:24 
AnswerRe: DockPanel Suite Pin
Henry Minute13-Jun-09 6:34
Henry Minute13-Jun-09 6:34 
GeneralRe: DockPanel Suite Pin
Rafone13-Jun-09 7:18
Rafone13-Jun-09 7:18 
Questioncannot load data from database to textbox in Visual c# 2008 Pin
Adekolurejo13-Jun-09 5:52
Adekolurejo13-Jun-09 5:52 
Please help me on this code.
Am trying to load data from sql server 2005 express into textbox in visual c# 2008 express. I want the data to be displayed in the textbox from the first record in the database but am having this error message

"Ths best overload method match for 'system.data.sqlclient.sqlcommand.sqlcommand(string,system.data.sqlclient.sqlcommand)' has some invalid arguments.

Please help cos I dont know what to do about this.
Thanks

private void COMPANY_INFO_Load(object sender, EventArgs e)
{
btnAdd.Enabled = true;
btnCancel.Enabled = false;
btnUpdate.Enabled = true;
btnSave.Enabled = false;

SqlConnectionStringBuilder myBuilder = new SqlConnectionStringBuilder();
myBuilder.UserID = "sa";
myBuilder.Password = "admin123";
myBuilder.InitialCatalog = "Kay_Nylon_Db";
myBuilder.DataSource = "ADEMOLAPC";
myBuilder.ConnectTimeout = (30);

SqlConnection conn = new SqlConnection(myBuilder.ConnectionString);

SqlDataReader myReader = null;

SqlCommand myCommand = new SqlCommand("select * from Company_Info", myBuilder);

myReader = myCommand.ExecuteReader();
while (myReader.Read())
{

Console.WriteLine(myReader["Company_Id"].ToString());
Console.WriteLine(myReader["Company_Name"].ToString());
Console.WriteLine(myReader["Company_Address_Line1"].ToString());
Console.WriteLine(myReader["Company_Address_Line2"].ToString());
Console.WriteLine(myReader["Fax"].ToString());
Console.WriteLine(myReader["Email"].ToString());
}

}
AnswerRe: cannot load data from database to textbox in Visual c# 2008 Pin
Henry Minute13-Jun-09 6:38
Henry Minute13-Jun-09 6:38 
QuestionRe: cannot load data from database to textbox in Visual c# 2008 Pin
Adekolurejo13-Jun-09 7:02
Adekolurejo13-Jun-09 7:02 
AnswerRe: cannot load data from database to textbox in Visual c# 2008 Pin
Dave Kreskowiak13-Jun-09 6:48
mveDave Kreskowiak13-Jun-09 6:48 
GeneralRe: cannot load data from database to textbox in Visual c# 2008 Pin
Adekolurejo13-Jun-09 7:23
Adekolurejo13-Jun-09 7:23 
AnswerRe: cannot load data from database to textbox in Visual c# 2008 Pin
alamree13-Jun-09 7:08
alamree13-Jun-09 7:08 
QuestionRe: cannot load data from database to textbox in Visual c# 2008 Pin
Adekolurejo13-Jun-09 7:25
Adekolurejo13-Jun-09 7:25 
Question[Message Deleted] Pin
hkjghkj113-Jun-09 5:46
hkjghkj113-Jun-09 5:46 
AnswerRe: Sound Delay Pin
Henry Minute13-Jun-09 6:40
Henry Minute13-Jun-09 6:40 
AnswerRe: Sound Delay Pin
Dave Kreskowiak13-Jun-09 6:45
mveDave Kreskowiak13-Jun-09 6:45 
AnswerRe: Sound Delay Pin
0x3c013-Jun-09 7:34
0x3c013-Jun-09 7:34 
Questiona question for OOP experts and Presentation/Business/DB Layer Pin
pierpaolo paparo13-Jun-09 4:14
pierpaolo paparo13-Jun-09 4:14 
AnswerRe: a question for OOP experts and Presentation/Business/DB Layer Pin
Colin Angus Mackay13-Jun-09 4:30
Colin Angus Mackay13-Jun-09 4:30 
GeneralRe: a question for OOP experts and Presentation/Business/DB Layer Pin
pierpaolo paparo14-Jun-09 0:27
pierpaolo paparo14-Jun-09 0:27 
QuestionGot an error -->An unhandled exception of type 'System.StackOverflowException' occurred in PROJECT pro.exe Pin
KIDYA13-Jun-09 2:34
KIDYA13-Jun-09 2:34 
AnswerRe: Got an error -->An unhandled exception of type 'System.StackOverflowException' occurred in PROJECT pro.exe Pin
Anthony Mushrow13-Jun-09 2:43
professionalAnthony Mushrow13-Jun-09 2:43 
GeneralRe: Got an error -->An unhandled exception of type 'System.StackOverflowException' occurred in PROJECT pro.exe Pin
Luc Pattyn13-Jun-09 3:00
sitebuilderLuc Pattyn13-Jun-09 3:00 
GeneralRe: Got an error -->An unhandled exception of type 'System.StackOverflowException' occurred in PROJECT pro.exe Pin
KIDYA13-Jun-09 18:17
KIDYA13-Jun-09 18:17 

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.