473,320 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

SqlClient

Hi,

I just started programming C++ so I trust this question is moderately dumb!
:->
In C# I could use the [] operator to access fields in the SqlDataReader
class. How do I do that in managed C++?

I tried using the Item object as well, but that did not work at all.
String* G = (String*)(*(BwData->Item("ProdId")));

Is there any similar way to access named fields in C++? I know I can
retrieve the values using get-methods, but I would rather acces them using
the [] operator.

Thanks,
Philip
Nov 16 '05 #1
1 1683
Philip,
I just started programming C++ so I trust this question is moderately dumb! :->
In C# I could use the [] operator to access fields in the SqlDataReader
class. How do I do that in managed C++?

I tried using the Item object as well, but that did not work at all.
String* G = (String*)(*(BwData->Item("ProdId")));

Is there any similar way to access named fields in C++? I know I can
retrieve the values using get-methods, but I would rather acces them using
the [] operator.


Then use it ;)

You probably want something like (warning: unchecked)

String* G = dynamic_cast<String*>(BwData->Item[S"ProdId"]);

--
Tomas Restrepo
to****@mvps.org

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tony Zoccolillo | last post by:
I have a SQL Server database on a Windows 2000 Server. I have IIS running on a 2nd 2000 Server with no SQL Server on it.. Neither are the PDC. Both servers have the most recent .NET framework...
2
by: Chris Langston | last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server that is experiencing strange shutdown problems. We are using ASP.NET v1.1 and our application is written in VB.NET ...
4
by: Arpan | last post by:
I am trying to retrieve records from a SQL Server 7.0 database table for which I am importing the Namespace System.Data.SQLClient using the following Import statement: <%@ Import...
2
by: James Cooke | last post by:
Hi all, I want to catch a duplicate key exception. I do not want to provide that verbose message from the MSSQL server - I would put a user friendly message out, like "The item you have added...
0
by: john | last post by:
I know that windows CE has a SQLCE client namespace but i do not want to use it because it needs to download my sql tables to a local sql database on the CE.NET client machine. I would rather have...
1
by: John Bailo | last post by:
I'm doing a profile on my SQL Server to see if I can eliminate any long running statements, and periodically, I see an entry for ".NET SqlClient Data Provider". The durations for it are very...
3
by: Rampa | last post by:
hello! the problem is always the same but i can't understand why it happens!! Someone can help me? FIRST QUERY GOES WELL, SECOND BREAK WITH ERROR why? Dim connessione As New...
5
by: mmatchyn | last post by:
I have been trying to create a class similar to SqlClient but one that prints sql statements instead of running them on the database. This way when I want to go into test mode I comment out the...
2
by: =?Utf-8?B?Y2hpZWtv?= | last post by:
Hello, We recently converted from ASP.net 1.X to ASP.net 2.0 application. Since then, we randomly get the SQL errors when the function tries to get records from SQL. We are using stored...
3
by: weird0 | last post by:
This is the exception that I get when i create a webserivce obj and call. The error comes on the webmethod call, when it opens a connection to the db. How do I fix it? What is the solution to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.