| | |
Urgent: I need Help in c++.net!
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
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:
___________________________
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
|
|
|
|
|
|
-------------------------------------
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:
//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.
};
____________________________________________________________________________________________________
//databaseDlg.h
//Declare the method here
public:
void CreateMySqlDataReader(char* mySelectQuery, char* myConnectionString);
____________________________________________________________________________________________________
//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:
void CdatabaseDlg::OnCbnSelchangeCombo1()
{
//Create an array to store the data.
String name[]={"","","","","","","","","","","","","","",""};
//How to Bind Data to comboBox???
ComboBox.
}
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:
___________________________
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
|
|
|
|
|
|
-------------------------------------
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:
//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.
};
____________________________________________________________________________________________________
//databaseDlg.h
//Declare the method here
public:
void CreateMySqlDataReader(char* mySelectQuery, char* myConnectionString);
____________________________________________________________________________________________________
//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:
void CdatabaseDlg::OnCbnSelchangeCombo1()
{
//Create an array to store the data.
String name[]={"","","","","","","","","","","","","","",""};
//How to Bind Data to comboBox???
ComboBox.
}
ANYONE PLS HELP!
From
Decruz
![]() |
Similar Threads
- sending sms using vb.net (VB.NET)
- ASP.NET - session objects Problem (ASP.NET)
- sms-chat application in vb.net(urgent help needed) (VB.NET)
- Need ASP.NET Web Developers - URGENT (ASP.NET)
- URGENT!: Saving Database information from ASP.NET Button (ASP.NET)
- plz help me to connect more than one table in the ms access database to the asp.net (ASP.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- extreme urgent help needed (Geeks' Lounge)
Other Threads in the ASP.NET Forum
- Previous Thread: How To Create A Remember Me Cookie
- Next Thread: struggling with connecting database to server
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox class click commonfunctions compatible confirmationcodegeneration content contenttype countryselector courier css dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dropdownmenu edit expose flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list listbox login menu microsoft mono mouse mssql multistepregistration nameisnotdeclared news numerical objects order panelmasterpagebuttoncontrols problem radio ratings rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webservice wizard xml youareanotmemberofthedebuggerusers





