Click here to Skip to main content
15,885,435 members
Home / Discussions / C#
   

C#

 
GeneralRe: Question about using an if in a string Pin
Dave Kreskowiak2-Sep-13 5:58
mveDave Kreskowiak2-Sep-13 5:58 
GeneralRe: Question about using an if in a string Pin
blitzkrieged2-Sep-13 14:16
blitzkrieged2-Sep-13 14:16 
AnswerRe: Question about using an if in a string Pin
liveoffedge2-Sep-13 0:15
professionalliveoffedge2-Sep-13 0:15 
GeneralRe: Question about using an if in a string Pin
OriginalGriff2-Sep-13 3:49
mveOriginalGriff2-Sep-13 3:49 
GeneralRe: Question about using an if in a string Pin
Keith Barrow2-Sep-13 6:21
professionalKeith Barrow2-Sep-13 6:21 
GeneralRe: Question about using an if in a string Pin
skeeterz713-Sep-13 6:30
skeeterz713-Sep-13 6:30 
AnswerRe: Question about using an if in a string Pin
AmitGajjar2-Sep-13 20:02
professionalAmitGajjar2-Sep-13 20:02 
QuestionDistinct Row or Rows in a datatable Pin
smh139231-Aug-13 22:00
smh139231-Aug-13 22:00 
Hi There !
in myTable I have 4 fields , MyId,FName,Lname,Year,Code
I want to Filter "Code" when the "Year" Field is equel to TextForm Like 2005 or --> Year=2005.
try
{
  OleDbConnection ocn = new OleDbConnection(ConnectionString);
  OleDbDataAdapter oda = new OleDbDataAdapter(@"SELECT MyId,FName,Lname,Year=<a href="/Members/P1">@p1</a>,Code,FROM myTable WHERE Code=<a href="/Members/P2">@p2</a>", ocn);
  oda.SelectCommand.Parameters.Clear();
  oda.SelectCommand.Parameters.AddWithValue("<a href="/Members/P1">@p1</a>",txtYear.Text);
  oda.SelectCommand.Parameters.AddWithValue("<a href="/Members/P2">@p2</a>",txtCode.Text);
  DataTable dt = new DataTable();
  dt.Clear();
  oda.Fill(dt);
  if (dt.Rows.Count > 0)
    {
      MessageBox.Show("This Code Used Before");
      txtCode.Focus();
    }
  else
   {
      ...

Thanks a Lot

modified 1-Sep-13 4:26am.

AnswerRe: Distinct Row or Rows in a datatable Pin
Mycroft Holmes31-Aug-13 22:42
professionalMycroft Holmes31-Aug-13 22:42 
GeneralRe: Distinct Row or Rows in a datatable Pin
smh13922-Sep-13 10:48
smh13922-Sep-13 10:48 
AnswerRe: Distinct Row or Rows in a datatable Pin
susanna.floora1-Sep-13 19:09
susanna.floora1-Sep-13 19:09 
GeneralRe: Distinct Row or Rows in a datatable Pin
Mycroft Holmes1-Sep-13 19:52
professionalMycroft Holmes1-Sep-13 19:52 
QuestionPut DLL file to another location Pin
Midnight Ahri31-Aug-13 14:43
Midnight Ahri31-Aug-13 14:43 
AnswerRe: Put DLL file to another location Pin
Dave Kreskowiak31-Aug-13 15:10
mveDave Kreskowiak31-Aug-13 15:10 
AnswerRe: Put DLL file to another location Pin
Abhinav S31-Aug-13 15:51
Abhinav S31-Aug-13 15:51 
QuestionHow to get user names accessing ACCESS database Pin
BajrangSingh31-Aug-13 8:22
BajrangSingh31-Aug-13 8:22 
AnswerRe: How to get user names accessing ACCESS database Pin
Dave Kreskowiak31-Aug-13 8:29
mveDave Kreskowiak31-Aug-13 8:29 
GeneralRe: How to get user names accessing ACCESS database Pin
BajrangSingh31-Aug-13 9:32
BajrangSingh31-Aug-13 9:32 
GeneralRe: How to get user names accessing ACCESS database Pin
Dave Kreskowiak31-Aug-13 10:30
mveDave Kreskowiak31-Aug-13 10:30 
GeneralRe: How to get user names accessing ACCESS database Pin
BajrangSingh31-Aug-13 18:40
BajrangSingh31-Aug-13 18:40 
GeneralRe: How to get user names accessing ACCESS database Pin
Dave Kreskowiak1-Sep-13 5:02
mveDave Kreskowiak1-Sep-13 5:02 
AnswerRe: How to get user names accessing ACCESS database Pin
Mycroft Holmes31-Aug-13 13:09
professionalMycroft Holmes31-Aug-13 13:09 
GeneralRe: How to get user names accessing ACCESS database Pin
jschell31-Aug-13 13:57
jschell31-Aug-13 13:57 
GeneralRe: How to get user names accessing ACCESS database Pin
Mycroft Holmes31-Aug-13 16:17
professionalMycroft Holmes31-Aug-13 16:17 
GeneralRe: How to get user names accessing ACCESS database Pin
BajrangSingh31-Aug-13 19:27
BajrangSingh31-Aug-13 19:27 

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.