Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

thuyphuongid

@thuyphuongid
About
Posts
6
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Programming time for algorithm? Anyone help me.................
    T thuyphuongid

    I have coded the following: --------------------------------------------- //file BT01.h class BT01 { public: int BruteForce(char *P, char *T); void InputText(char *T, char *P); }; --------------------------------------------------- //file BT01.cpp #include "BT01.h" #include "time.h" #include "dos.h" #include <iostream> #include <conio.h> #include <stdio.h> using namespace std; int BT01::BruteForce(char *P, char *T) { //duyet T for (int i = 0; i <= strlen(T) - strlen(P); i++) { //khai bao j int j = 0; //duyet P while (j < strlen(P)) { //Kiem tra ptu tai T tai vi tri thu i + j co bang j hay khong? xu ly if (tolower(T[i + j]) == tolower(P[j])) j++; else break; } //Tim thay if (j == strlen(P)) return i; } //khong tim thay return -1; } void BT01::InputText(char *T, char *P) { do{ printf("T: "); gets(T); } while (strlen(T) < 1); do{ printf("P: "); gets(P); } while(strlen(P) < 1 || strlen(P) > strlen(T)); } void main() { char *P = new char[20]; char *T = new char[999]; printf("BAI TAP TH01 - THUAT TOAN BRUTEFORCE\n"); BT01 objBT01; objBT01.InputText(T, P); int kq; kq = objBT01.BruteForce(P, T); if (kq == -1) printf("KQ: Khong tim thay."); else printf("\nKQ: %i, %i", kq, strlen(T)); printf("\nThoi gian (ms): "); getch(); } I would like to count time for Algorithm BruteForce. How to count?

    modified on Monday, December 22, 2008 11:00 PM

    C / C++ / MFC c++ algorithms help tutorial question

  • C# - Get DataTable from Access. Please, help me. I can not know this bugs.
    T thuyphuongid

    Ok. Thank you for your help. See u later.

    C# help csharp

  • C# - Get DataTable from Access. Please, help me. I can not know this bugs.
    T thuyphuongid

    Sorry! It is not contain mUti. It correct: DataTable lTbl = PGetDataTable(mConnectString, mStrSQL, "tbl");

    C# help csharp

  • C# - Get DataTable from Access. Please, help me. I can not know this bugs.
    T thuyphuongid

    v: express variable of method l: local in method. vStrSQL = "select * from User where user = 'aaa' and passwd = 'bb'; I tested vStrSQL on MS Access. It is true. It used folow: vStrSQL = "select * from User where User = '" + txtUser.Text + "' and Passwd = '" + txtPassword.Text + "'"; DataTable lTbl = mUti.PGetDataTable(mConnectString, mStrSQL, "tbl"); //// Error ... System.Data.OleDb.OleDbException: Syntax error in FROM clause. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

    C# help csharp

  • C# - Get DataTable from Access. Please, help me. I can not know this bugs.
    T thuyphuongid

    vConn is string: @"Provider = Microsoft.Jet.OLEDB.4.0; Data source = Dat.mdb"; I code like that. So, I want to build Library for Access.

    C# help csharp

  • C# - Get DataTable from Access. Please, help me. I can not know this bugs.
    T thuyphuongid

    I coded folowing: public void PWriteToEventLog(Exception ex) { EventLog lLog = new EventLog(); lLog.Source = "Data Access Error... "; lLog.WriteEntry(ex.Message.ToString()); } public DataTable PGetDataTable(string vConn, string vStrSQL, string vTableName) { //variable to return DataTable lDataTable; //variable to process OleDbConnection lConn = new OleDbConnection(vConn); OleDbCommand lComm = new OleDbCommand(vStrSQL, lConn); OleDbDataAdapter lAdapter = new OleDbDataAdapter(); try { lConn.Open(); lAdapter.SelectCommand = lComm; } catch (Exception ex) { this.PWriteToEventLog(ex); throw new Exception("Error from [PGetDataTable]\n" + ex.ToString()); } try { lDataTable = new DataTable(vTableName); lAdapter.Fill(lDataTable); lConn.Close(); } catch (Exception ex) { this.PWriteToEventLog(ex); throw new Exception("Error ... \n" + ex.ToString()); } return lDataTable; } When I run. It notice bug: Unhandle exception has your occured in your application. Error... system.data.oledbexception: sysntax error in from Clause.

    C# help csharp
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups