473,804 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FindByPrimaryKe y(keyID) returns null

I use a dataset and autogenerated logic codes.
VS2005 generated FindByPrimaryKe y method but the method
returns null instead of the related row even ı use a valid key.
The lines are below:

//DataTable
DataSetOrganiza syon.tableGeziD ataTable tblGeziDT = new
DataSetOrganiza syon.tblGeziDat aTable();

//DataTableAdapte r
DataSetOrganiza syonTableAdapte rs.tblGeziTable Adapter tblGeziTA = new
Organizasyon.st rDataSetOrganiz asyonTableAdapt ers.tblGeziTabl eAdapter();

tblGeziRow = tblGeziDT.FindB ygeziID(intAkti fOrganizasyonID );

Now I cannot load the data...

Autogenerated lines are below:
[System.Diagnost ics.DebuggerNon UserCodeAttribu te()]
public tblGeziRow NewtblGeziRow() {
return ((tblGeziRow)(t his.NewRow()));
}

Apr 12 '07 #1
4 2420
I think it doesn't attemp to read the row from the DB and just load the data
from
datatable object..... And I should load the data from the sql server...

"Nime" <ni**@yes.no> , haber iletisinde şunları
yazdı:OO******* *******@TK2MSFT NGP02.phx.gbl.. .
>I use a dataset and autogenerated logic codes.
VS2005 generated FindByPrimaryKe y method but the method
returns null instead of the related row even ı use a valid key.
The lines are below:

//DataTable
DataSetOrganiza syon.tableGeziD ataTable tblGeziDT = new
DataSetOrganiza syon.tblGeziDat aTable();

//DataTableAdapte r
DataSetOrganiza syonTableAdapte rs.tblGeziTable Adapter tblGeziTA = new
Organizasyon.st rDataSetOrganiz asyonTableAdapt ers.tblGeziTabl eAdapter();

tblGeziRow = tblGeziDT.FindB ygeziID(intAkti fOrganizasyonID );

Now I cannot load the data...

Autogenerated lines are below:
[System.Diagnost ics.DebuggerNon UserCodeAttribu te()]
public tblGeziRow NewtblGeziRow() {
return ((tblGeziRow)(t his.NewRow()));
}

Apr 12 '07 #2
Related sample is here:
http://msdn2.microsoft.com/en-us/lib...h1(vs.80).aspx

I'm not sure hot to load the data by primary key...

"Nime" <ni**@yes.no> , haber iletisinde şunları
yazdı:%2******* *********@TK2MS FTNGP06.phx.gbl ...
>I think it doesn't attemp to read the row from the DB and just load the
data from
datatable object..... And I should load the data from the sql server...

"Nime" <ni**@yes.no> , haber iletisinde şunları
yazdı:OO******* *******@TK2MSFT NGP02.phx.gbl.. .
>>I use a dataset and autogenerated logic codes.
VS2005 generated FindByPrimaryKe y method but the method
returns null instead of the related row even ı use a valid key.
The lines are below:

//DataTable
DataSetOrganiz asyon.tableGezi DataTable tblGeziDT = new
DataSetOrganiz asyon.tblGeziDa taTable();

//DataTableAdapte r
DataSetOrganiz asyonTableAdapt ers.tblGeziTabl eAdapter tblGeziTA = new

Organizasyon.s trDataSetOrgani zasyonTableAdap ters.tblGeziTab leAdapter();

tblGeziRow = tblGeziDT.FindB ygeziID(intAkti fOrganizasyonID );

Now I cannot load the data...

Autogenerate d lines are below:
[System.Diagnost ics.DebuggerNon UserCodeAttribu te()]
public tblGeziRow NewtblGeziRow() {
return ((tblGeziRow)(t his.NewRow()));
}


Apr 12 '07 #3
Nime,

Well, you are calling FindBygezID on an empty data table. You need to
use the data adapter you created to populate the data table, or add rows
yourself.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Nime" <ni**@yes.nowro te in message
news:OO******** ******@TK2MSFTN GP02.phx.gbl...
>I use a dataset and autogenerated logic codes.
VS2005 generated FindByPrimaryKe y method but the method
returns null instead of the related row even ı use a valid key.
The lines are below:

//DataTable
DataSetOrganiza syon.tableGeziD ataTable tblGeziDT = new
DataSetOrganiza syon.tblGeziDat aTable();

//DataTableAdapte r
DataSetOrganiza syonTableAdapte rs.tblGeziTable Adapter tblGeziTA = new
Organizasyon.st rDataSetOrganiz asyonTableAdapt ers.tblGeziTabl eAdapter();

tblGeziRow = tblGeziDT.FindB ygeziID(intAkti fOrganizasyonID );

Now I cannot load the data...

Autogenerated lines are below:
[System.Diagnost ics.DebuggerNon UserCodeAttribu te()]
public tblGeziRow NewtblGeziRow() {
return ((tblGeziRow)(t his.NewRow()));
}

Apr 12 '07 #4
THANK YOU A LOT : ) NOW I CAN SEE THE ROW!
tblGeziTA.Fill( tblGeziDT); //I'VE ADDED THIS LINE

tblGeziRow = tblGeziDT.FindB ygeziID(intAkti fOrganizasyonID );

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om>, haber
iletisinde şunları yazdı:%2******* *********@TK2MS FTNGP03.phx.gbl ...
Nime,

Well, you are calling FindBygezID on an empty data table. You need to
use the data adapter you created to populate the data table, or add rows
yourself.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Nime" <ni**@yes.nowro te in message
news:OO******** ******@TK2MSFTN GP02.phx.gbl...
>>I use a dataset and autogenerated logic codes.
VS2005 generated FindByPrimaryKe y method but the method
returns null instead of the related row even ı use a valid key.
The lines are below:

//DataTable
DataSetOrganiz asyon.tableGezi DataTable tblGeziDT = new
DataSetOrganiz asyon.tblGeziDa taTable();

//DataTableAdapte r
DataSetOrganiz asyonTableAdapt ers.tblGeziTabl eAdapter tblGeziTA = new

Organizasyon.s trDataSetOrgani zasyonTableAdap ters.tblGeziTab leAdapter();

tblGeziRow = tblGeziDT.FindB ygeziID(intAkti fOrganizasyonID );

Now I cannot load the data...

Autogenerate d lines are below:
[System.Diagnost ics.DebuggerNon UserCodeAttribu te()]
public tblGeziRow NewtblGeziRow() {
return ((tblGeziRow)(t his.NewRow()));
}


Apr 13 '07 #5

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

Similar topics

0
1835
by: Borek | last post by:
In my project I have to access in one business method of session bean usually more then 10 CMP Beans. I would like to have some utils classes, which could get me right instance of CMP or create one. Instead of making the same thing again and again. My proposition looks like: 1) Class for taking home interface: public final class JNDILookup { private static Context initialContext; private static HashMap homeInterfaces; private static...
2
1604
by: veremue | last post by:
I want to pass my Iterator to a JSP in the following code code: Java public class PolicyUpdateUtils { public static void UpdatePolicyIncreases(){ PolicyLocalHome ppH = (PolicyLocalHome)Utils.getBeanHome("Policy"); PolicyLocal policyL = null; IncreasesLocalHome incH = (IncreasesLocalHome)Utils.getBeanHome("Increases"); IncreasesLocal incL = null;
7
2249
oll3i
by: oll3i | last post by:
in deploytool when i go to "cmp database" i get the message "cannot find accessor getFirstName for CMP field firstName"?
0
9712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10089
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.