Ado.net DataSet Refresh

  • Thread starter Thread starter Guest
  • Start date Start date
Hello Manjree,

This is System.NullReferenceException.
I'd like to suggest you check if there is object returned by
expDataTable->Rows->Find(search) method.

Please change your code as below, and check if it will thow
System.NullReferenceException in Line 2.

DataRow^ row = expDataTable->Rows->Find(search);
System::Object^ o=row->default[L"data"];
array<Byte>^ data = (array<Byte>^)o;

Using an Array declaration as casting operator should be the correct method.
Under my test, It works fine.

Please try the above method and let me know if NullReferenceException thown
in Line 2.
System::Object^ o=row->default[L"data"];

Hope this helps,
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Thanks Wen. You are right. The problem was in Find(). It did work.

Thanks a lot for your time.

Manjree
 
You are welcome, Manjree.

Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hello Wen

I am trying to include a CCheckListBox into my VC++ user interface. In the
on line help it says to declare a class derived from the CCheckListBox and
then use its Create function. I am doing the same as shown in the example:

class CMyCheckListBox : public CCheckListBox
{
DECLARE_DYNAMIC(CMyCheckListBox)

// Constructors
public:
CMyCheckListBox();
BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
};

and then declaring a variable of this class like:

CMyCheckListBox chListBox;
chListBox.Create(.....);



but as there is no definition of the Create function in my code it is
giving the error:

error LNK2001: unresolved external symbol "public: virtual int __thiscall
CMyCheckListBox::Create(unsigned long,struct tagRECT const &,class CWnd
*,unsigned int)" (?Create@CMyCheckListBox@@UAEHKABUtagRECT@@PAVCWnd@@I@Z)

What's the right way of using it? I couldn't find any example of it.

If you could let me know that will be great.

Thanks.

Manjree
 
Hi Manjree,
Did you have an implementation of CMyCheckListBox::Create in your .cpp file?
I just saw the declaration of Create function in the header file, however I
did not see its implementation.

What is the result if you add the implementation in your MyCheckListBox.cpp
file:
BOOL CMyCheckListBox::Create(DWORD dwStyle, const RECT& rect, CWnd*
pParentWnd, UINT nID)
{
//To do something for your customization
......
return TRUE;
}

Also, I strongly recommend that you declare your Create method with virtual
modifier since you would like to override the member function of the base
class:
virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT
nID);

Hope this helps. Please feel free to let us know if you have any other
questions or concerns.

Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
 
Hello Manjree,

It seems this is a MFC issue (which is different from ADO.net), but not
very complex. I have discussed with another support engineer (Charles Wang)
who owned MFC issue in Newsgroup (microsoft.public.vc.mfc). He will follow
up here by the end of today. Please wait a moment. thanks.

However, I'm afraid this thread is too long (included 54 posts). It's
really difficult to read and check the issue status. Would you please post
a new thread in group next time? Therefore, our community member and us
could read it easy and provide more information.:)

The completed MSDN managed newsgroup list could be found here:
http://msdn2.microsoft.com/en-us/subscriptions/aa974230.aspx
In MSDN managed newsgroup, our engineers will monitor every issue thread
posted by MSDN subscribers.

For MFC issue, you may post it in microsoft.public.vc.mfc. This is also
managed newsgroup, we will follow up on time. In additon, more people and
MVPs could help you in the related filed.

Have a great day.
Please let me know if you have any more concern on this. We are glad to
assist you.
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top