| | |
Urgent Pls Help: My codes are in errors!
![]() |
•
•
Join Date: Aug 2005
Posts: 3
Reputation:
Solved Threads: 0
I want to fetch data from SQL Server 2000 using tcp/ip connection
and display on the client.
Q : How do i fetch data from SQL Server 2000 and put the data on a combo box.
Q: My server user interface will have "Fetch" button ?
Client User Interface:
My server program software is Ms Visual Studio.NET 2003.
Lanuage is C++
Appreciate the kind help recieved.
Q1) COULD YOU PLS CHECK THE FOLLOWING C++ CODES:
____________________________________________________________________________________________________
____________________________________________________________________________________________________
_____________________________________________________________________________________________________
Errors: Leading to database.cpp and databaseDld.cpp
c:\Documents and Settings\Student\Desktop\database\databaseDlg.cpp(9): fatal error C1190: managed targeted code requires '#using <mscorlib.dll>' and '/clr' option
c:\documents and settings\student\desktop\database\database.cpp(84): warning C4717: 'CdatabaseDlg::CreateMySqlDataReader' : recursive on all control paths, function will cause runtime stack overflow
Problem:
Q2) DEBUGGING PROBLEM: ABOVE ERRORS
Q3) IM NOT SURE HOW TO BIND DATA INTO COMBOBOX IN C++ LANG
____________________________________________________________________________________________________
Data to bind to ComboBox:
___________________________
Inside the comboBox Method:
ANYONE PLS HELP!
From
Decruz
and display on the client.
Q : How do i fetch data from SQL Server 2000 and put the data on a combo box.
Q: My server user interface will have "Fetch" button ?
Client User Interface:
C++ Syntax (Toggle Plain Text)
___________________________ Category: | o Books o Stationey | } Radio Buttons: If Books is choose, books items will display o accessories o I.T Stuffs | } | _________ | Item: |____|_^_|------------------------> {ComboBox} The data is retrieved /fetch from SQL Server 2000 by tcp/ip | | | | | | -------------------------------------
Lanuage is C++
Appreciate the kind help recieved.
Q1) COULD YOU PLS CHECK THE FOLLOWING C++ CODES:
C++ Syntax (Toggle Plain Text)
//databaseDlg.cpp #using <mscorlib.dll> #using <System.dll> #using <System.Data.dll> void CdatabaseDlg::CreateMySqlDataReader(char* mySelectQuery, char* myConnectionString) { SqlConnection* myConnection = new SqlConnection(myConnectionString "provider=sqloledb;Data Source=local;Initial Catalog=PRODUCT;User Id=temp;Password=password;"); SqlCommand* myCommand = new SqlCommand(mySelectQuery "SELECT ITEM FROM PRODUCT", myConnection); myConnection->Open(); SqlDataReader* myReader = myCommand->ExecuteReader(CommandBehavior::CloseConnection); while(myReader->Read()) { Console::WriteLine(myReader->GetString(0)); } myReader->Close(); //Implicitly closes the connection because CommandBehavior::CloseConnection was specified. };
C++ Syntax (Toggle Plain Text)
//databaseDlg.h //Declare the method here public: void CreateMySqlDataReader(char* mySelectQuery, char* myConnectionString);
____________________________________________________________________________________________________
C++ Syntax (Toggle Plain Text)
//database.cpp //Call the Method here void CdatabaseDlg::CreateMySqlDataReader(char* mySelectQuery, char* myConnectionString) { CdatabaseDlg call; call.CreateMySqlDataReader("SELECT ITEM FROM PRODUCT", "provider=sqloledb;Data Source=local;Initial Catalog=MENU;User Id=temp;Password=password"); }
_____________________________________________________________________________________________________
Errors: Leading to database.cpp and databaseDld.cpp
c:\Documents and Settings\Student\Desktop\database\databaseDlg.cpp(9): fatal error C1190: managed targeted code requires '#using <mscorlib.dll>' and '/clr' option
c:\documents and settings\student\desktop\database\database.cpp(84): warning C4717: 'CdatabaseDlg::CreateMySqlDataReader' : recursive on all control paths, function will cause runtime stack overflow
Problem:
Q2) DEBUGGING PROBLEM: ABOVE ERRORS
Q3) IM NOT SURE HOW TO BIND DATA INTO COMBOBOX IN C++ LANG
____________________________________________________________________________________________________
Data to bind to ComboBox:
___________________________
Inside the comboBox Method:
C++ Syntax (Toggle Plain Text)
void CdatabaseDlg::OnCbnSelchangeCombo1() { //Create an array to store the data. String name[]={"","","","","","","","","","","","","","",""}; //How to Bind Data to comboBox??? ComboBox. }
ANYONE PLS HELP!
From
Decruz
Last edited by Dave Sinkula; Aug 20th, 2005 at 4:31 pm. Reason: Added code tags.
•
•
Join Date: Aug 2005
Posts: 3
Reputation:
Solved Threads: 0
Hi Sutanu!
I'm using tcp/ip to transfer those data from my sql server 2000 to my client.
You suggest that to use:
Rather creater a dsn to be used over the network to access the sqlserver data.
From your Cpp file use Sqlconnect using the dsn name. Prepare the stmt and exceute the sql statement to retrieve the data.
Q1) How do i do that?
Q2) Can you provide some source codes?
Thank You
I'm using tcp/ip to transfer those data from my sql server 2000 to my client.
You suggest that to use:
Rather creater a dsn to be used over the network to access the sqlserver data.
From your Cpp file use Sqlconnect using the dsn name. Prepare the stmt and exceute the sql statement to retrieve the data.
Q1) How do i do that?
Q2) Can you provide some source codes?
Thank You
![]() |
Similar Threads
- Urgent Help- Printing Screen (Pascal and Delphi)
- Urgent: I need Help in c++.net! (ASP.NET)
- print datagrid (JavaScript / DHTML / AJAX)
- Urgent: Please Help Computer Keep Saying Kernel_data_inpage_error And Some Times Kern (Storage)
- how do i bring my pc back to life (Troubleshooting Dead Machines)
- which version you recommend ? (C++)
Other Threads in the C++ Forum
- Previous Thread: unsigned character pointer to Hex values
- Next Thread: Prime Factorization
| Thread Tools | Search this Thread |
ada api array backup based binary bitmap c++ c/c++ char class classes code coding compile console conversion count delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file fileread forms fstream function functions game givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer pong prime problem program programming project python random read recursion reference rpg set string strings symbian temperature template test text text-file tree url variable vector video visual win32 windows winsock word wordfrequency wxwidgets





