Click here to Skip to main content
15,919,028 members
Home / Discussions / C#
   

C#

 
GeneralRe: I know I'm missing something Pin
Glen Harvy16-Aug-06 2:17
Glen Harvy16-Aug-06 2:17 
AnswerRe: I know I'm missing something Pin
V.16-Aug-06 2:25
professionalV.16-Aug-06 2:25 
GeneralRe: I know I'm missing something Pin
Guffa16-Aug-06 2:50
Guffa16-Aug-06 2:50 
GeneralRe: I know I'm missing something Pin
V.16-Aug-06 3:12
professionalV.16-Aug-06 3:12 
GeneralRe: I know I'm missing something Pin
Glen Harvy16-Aug-06 12:56
Glen Harvy16-Aug-06 12:56 
GeneralRe: I know I'm missing something Pin
V.16-Aug-06 20:32
professionalV.16-Aug-06 20:32 
Questiondoubt on URLDownloadToFile Pin
Bibhu shankar15-Aug-06 23:19
Bibhu shankar15-Aug-06 23:19 
Questiondisplay data on textboxes from database using classes [modified] Pin
Mamphekgo15-Aug-06 22:01
Mamphekgo15-Aug-06 22:01 
Hi. i am still new on C#.i am trying to display data on the texboxes from database using classes but it doesn't display any data where as is there here is my class.

public void SeachCustomer(string CName,string CNum)
{
CustomerName = CName;
Barcode1 = CNum;


SqlConnection conn = new SqlConnection();
conn.ConnectionString = "integrated security=SSPI;initial catalog=Phusa;server = za211149;persist security info=False";
conn.Open();
try
{
SqlCommand cmdSearch = new SqlCommand();
cmdSearch.Connection = conn;
cmdSearch.CommandText = "SELECT CustomerName FROM Events WHERE Barcode1 =@Barcode1";

SqlParameter Bar = new SqlParameter();
Bar.ParameterName = "@Barcode1";
Bar.Direction = System.Data.ParameterDirection.Output;
Bar.Value = Barcode1;
cmdSearch.Parameters.Add(Bar);
SqlParameter Nam = new SqlParameter();
Nam.ParameterName="@CustomerName";
Nam.Direction = System.Data.ParameterDirection.Output;
Nam.Value =CustomerName;
cmdSearch.Parameters.Add(Nam);

SqlDataReader dr =cmdSearch.ExecuteReader();

while(dr.Read()==true)
{

CustomerName = dr["CustomerName"].ToString();

}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
conn.Close();
}



-- modified at 4:02 Wednesday 16th August, 2006
AnswerRe: display data on textboxes from database using classes Pin
coolestCoder16-Aug-06 0:18
coolestCoder16-Aug-06 0:18 
AnswerRe: display data on textboxes from database using classes Pin
Mamphekgo16-Aug-06 0:54
Mamphekgo16-Aug-06 0:54 
GeneralRe: display data on textboxes from database using classes Pin
coolestCoder16-Aug-06 1:13
coolestCoder16-Aug-06 1:13 
Questionwhich method is the best than others and why? (Type convert) Pin
CooperWu15-Aug-06 21:59
CooperWu15-Aug-06 21:59 
AnswerRe: which method is the best than others and why? (Type convert) Pin
Guffa15-Aug-06 22:28
Guffa15-Aug-06 22:28 
GeneralRe: which method is the best than others and why? (Type convert) Pin
CooperWu15-Aug-06 22:40
CooperWu15-Aug-06 22:40 
GeneralRe: which method is the best than others and why? (Type convert) Pin
leppie15-Aug-06 22:45
leppie15-Aug-06 22:45 
GeneralRe: which method is the best than others and why? (Type convert) Pin
CooperWu15-Aug-06 22:56
CooperWu15-Aug-06 22:56 
GeneralRe: which method is the best than others and why? (Type convert) Pin
Guffa15-Aug-06 23:20
Guffa15-Aug-06 23:20 
GeneralRe: which method is the best than others and why? (Type convert) Pin
leppie15-Aug-06 23:40
leppie15-Aug-06 23:40 
AnswerRe: which method is the best than others and why? (Type convert) Pin
beatles169215-Aug-06 23:07
beatles169215-Aug-06 23:07 
GeneralRe: which method is the best than others and why? (Type convert) [modified] Pin
CooperWu16-Aug-06 0:00
CooperWu16-Aug-06 0:00 
AnswerRe: which method is the best than others and why? (Type convert) Pin
CooperWu16-Aug-06 0:22
CooperWu16-Aug-06 0:22 
AnswerRe: which method is the best than others and why? (Type convert) Pin
User 665816-Aug-06 1:46
User 665816-Aug-06 1:46 
Questionproblem with panels ? help please ... Pin
cmpeng3415-Aug-06 21:40
cmpeng3415-Aug-06 21:40 
AnswerRe: problem with panels ? help please ... Pin
coolestCoder16-Aug-06 0:26
coolestCoder16-Aug-06 0:26 
Questionpopup of word on page--word in database [modified] Pin
kamalsss15-Aug-06 21:30
kamalsss15-Aug-06 21:30 

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.