473,385 Members | 1,661 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,385 software developers and data experts.

Sybase issue

3
Hi All,

I am new to .NET programming and I am writing an application that gets some data from Sybase DB then displays it in the UI. So far this is what I have. The problem is that the data does not seem to be stored in the collections and therefore cannot be diplayed in the UI. Would appreciate any help. Thanks!

Expand|Select|Wrap|Line Numbers
  1. public partial class MainWindow : Window
  2.     {
  3.         public MainWindow()
  4.         {
  5.             this.InitializeComponent();
  6.  
  7.             // Insert code required on object creation below this point.
  8.         }
  9.         private List<Party> LoadPartyData()
  10.         {
  11.             List<Party> teams = new List<Party>();
  12.  
  13.             return teams;
  14.         }
  15.         private List<Person> LoadPersonData()
  16.         {
  17.             List<Person> analysts = new List<Person>();
  18.  
  19.             return analysts;
  20.         }
  21.  
  22.         private Party CreateParty(int PartyID, string PartyName)
  23.         {
  24.             Party party = new Party();
  25.             party.PartyID = PartyID;
  26.             party.PartyName = PartyName;
  27.  
  28.             return party;
  29.         }
  30.  
  31.         private Person CreatePerson(int PersonID, string FullName)
  32.         {
  33.             Person person = new Person();
  34.             person.PersonID = PersonID;
  35.             person.FullName = FullName;
  36.  
  37.             return person;
  38.         }
  39.  
  40.         public void GetData()
  41.         {
  42.             List<Party> teams = new List<Party>();
  43.             List<Person> analysts = new List<Person>();
  44.  
  45.             AseConnection connection = new AseConnection("Data Source=london01data.com;Port=0000;Database=data_sybase;Uid=user01;Pwd=pass01;");
  46.  
  47.             AseCommand command = new AseCommand("SELECT TOP 100 party_group_id, party_group_name FROM PartyGroup");
  48.             AseCommand command2 = new AseCommand("SELECT TOP 100 person_id, full_name FROM Person");
  49.  
  50.             command.Connection = connection;
  51.             command2.Connection = connection;
  52.  
  53.             connection.Open();
  54.  
  55.             using (AseDataReader reader = command.ExecuteReader())
  56.             {
  57.                 while (reader.Read())
  58.                 {
  59.                     Party party = new Party();
  60.                     party.PartyID = Convert.ToInt32(reader["party_group_id"]);
  61.                     party.PartyName = reader["party_group_name"].ToString();
  62.  
  63.                     teams.Add(party);
  64.  
  65.                     //Console.WriteLine(reader["full_name"].ToString());
  66.                 }
  67.             }
  68.  
  69.             using (AseDataReader reader = command2.ExecuteReader())
  70.             {
  71.                 while (reader.Read())
  72.                 {
  73.                     //if(reader["full_name"] != DBNull.Value)
  74.                     //  analysts.Add(reader["full_name"].ToString());                    
  75.                         Person person = new Person();
  76.                         person.PersonID = Convert.ToInt32(reader["person_id"]);
  77.                         person.FullName = reader["full_name"].ToString();
  78.  
  79.                     analysts.Add(person);
  80.                 }
  81.             }
  82.             connection.Close();
  83.  
  84.  
  85.         }
Nov 8 '10 #1
0 1395

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ajay | last post by:
Hi all, I am using VC++ DOT NET. The database is Sybase. I have established connectivity through ODBC 12.5 Sybase ASE Driver( its not through DSN). There is problem while reteriving values of...
1
by: Wellingotn Rampazo | last post by:
Hi guyz.... I'd like to know if anyone has already used C# components (COM+) or C# WebServices connected with Sybase System 11. Are there anyone who knows about it ? What driver version ? or...
2
by: eight02645999 | last post by:
hi i am writing a CGI to process some database transactions using the Sybase module. so in my CGI script, i have: .... import Sybase import cgitb; cgitb.enable(display=1 ,...
1
by: db2sysc | last post by:
All, We have listed out the INBUILT Function differences between Sybase and DB2. Kindly provide your feedback or corrections and for CHANGES - DO WE NEED TO CODE our own UDFs?
0
by: tombsy | last post by:
I have an Access97 frontend using linked tables to a sybase database via ODBC DSN. Sometimes but not always the linked table becomes read only. After refreshing the links it may or may not return...
0
by: Metal2You | last post by:
I'm working on an ASP.NET 2.0 application in Visual Studio 2005 that accesses a Sybase database back end. We're using Sybase SQL Anywhere 9.0.2.3228. I have installed and registered the Sybase...
4
by: Dan | last post by:
I have compiled and installed sybase-.037 , the module to add sybase to python. However, when I try to use it I get Import error: /usr/local/lib/python2.3/site-packages/sybasect.so undefined...
3
by: Alex Murphy | last post by:
As title, Thanks
26
by: codercode | last post by:
I'm working on a Visual Basic .NET using Access database. However, my client already have a 30MB database with Sybase ASA and Sybase is way too much for that. Is there anyway I can migrate from a...
0
by: =?ISO-8859-1?Q?S=E9bastien_Sabl=E9?= | last post by:
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. The module is...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.