473,657 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help needed!!

1 New Member
Hi all!!! I found this piece of code from one of the threads here, I too want to get the list of tables and data types of columns, but when i tried to use this code in my program it gives me error:
"WindowsApplica tion2\Form1.cs( 202): The type or namespace name 'TableInfo' could not be found (are you missing a using directive or an assembly reference?)"

and similar errors for m_oleDbSrcConn and table info obj... which namespaces do u think are needed?? what else could be the problem..




Expand|Select|Wrap|Line Numbers
  1. private void GetTableInfo()
  2. {
  3. DataRowView drvCols = null;
  4. DataTable dtCols = null;
  5. DataView dvColumns = null;
  6. TableInfo tabInfoObj = null;
  7. string sTableNm = null;
  8. string sNamePrefix = null;
  9. string sColName = null;
  10. int nColType = 0;
  11.  
  12. // Get the list of tables that there are.
  13. DataTable schemaTab =
  14. m_oleDbSrcConn.GetOleDbSchemaTable(OleDbSchemaGuid .Tables,
  15. new Object[] {null, null, null, "TABLE"});
  16.  
  17. for (int i = 0; i < schemaTab.Rows.Count; i++)
  18. {
  19. sTableNm = schemaTab.Rows[i].ItemArray[2].ToString();
  20. sNamePrefix = sTableNm.Substring(0, 4);
  21.  
  22. if ((sTableNm != "_NEW_TABLES") && (sNamePrefix != "temp"))
  23. {
  24. tabInfoObj = new TableInfo(sTableNm);
  25.  
  26. // Get the column name and its type and sort them
  27. // according to their position in the table.
  28. dtCols = m_oleDbSrcConn.GetOleDbSchemaTable(
  29. OleDbSchemaGuid.Columns,
  30. new Object[]{null,null, sTableNm, null});
  31. dvColumns = new DataView(dtCols);
  32. dvColumns.Sort = "ORDINAL_POSITION";
  33.  
  34. // Get the column names and their types.
  35. for (int j=0; j< dvColumns.Count; j++)
  36. {
  37. // Get the name of the column.
  38. drvCols = dvColumns[j];
  39. sColName = drvCols.Row.ItemArray[3].ToString();
  40.  
  41. // Get columns data type code and save it off.
  42. nColType = Convert.ToInt32(drvCols.Row.ItemArray[11]);
  43. tabInfoObj.AddColumn(sColName, nColType);
  44. m_alTables.Add(tabInfoObj);
  45. }
  46. } // if
  47.  
  48. } // for
  49. }
Mar 15 '07 #1
1 1090
kenobewan
4,871 Recognized Expert Specialist
Are you using System.Windows. Forms?
Mar 15 '07 #2

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

Similar topics

6
2958
by: Sims | last post by:
Hi, Given a string $txt and an array of strings $txt_array what would be the best/fastest way to search in _insensitive_ case if $txt is in $text_array and, if it is, where is it? Because I want to use the array with an ID Something like,
6
2667
by: Jack Smith | last post by:
Help needed on this question. Any help is appreciated. Thanks in advance. Given a binary string (i.e. a finite sequence of 0's and 1's) we choose any two digit substring 01 and replace it by a string of the form 100...0 using an arbitrary (but finite) number of zeros. Prove by induction that this transformation can not be performed infinitely many times, i.e. this sequence of transformations must terminate for any input string.
1
1974
by: worzel | last post by:
Hi All, I am looking for a reg ex that will match email addresses withing <a href=mailto blah > links. Actually, I already crafted my own, but with a slight problem: <a href="mailto:fred@blah.com"> emal me</a> woud be matched as expected, but so will:
2
1482
by: Willie | last post by:
I try to setup SQL Server to work with .NET Framework Anyone here willing to help? Step By Step Help Needed. Thanks
14
2175
by: tbird2340 | last post by:
I want to write an if / then statement and have tried using this: var MyVarMailto; if (Request.Form("LoanRequest") == "Under $250,000") { if (Request.Form("Organization") == "1") { MyVarMailto = "emailA@address.com"; } } else if (Request.Form("LoanRequest") == "Over $250,000") { if (Request.Form("Organization") == "1") {
1
1736
by: BHPexpert | last post by:
Regular Expression help needed -------------------------------------------------------------------------------- I want to extract all text that is contained inside the brackets after the word INDIRECT. There must be at least one pair of parentheses, they may be multiple pairs for exampple, this string '=IF($B$9="Off",0,INDIRECT(ADDRESS(1(8),COLUMNS($A$41:C41),,,$B$9 )),()aaaa' has four bracket pairings until the initial "(" is...
1
1267
by: Brian Gallagher | last post by:
I have an aspnet application which I only want part of to be avaliable between the hours of 9am and 5:30pm but I dont know where to start. Help needed!
0
2578
by: Christopher | last post by:
Urgent Help Needed: The EPVH-1.1 Visual Hull Library. Dear All, I am a student doing research in computer vision. The EPVH-1.1 Visual Hull Library will really help a lot in my research. I did have this library before but I didn't keep my copy of this library because I always thought I could download it again form internet. However, the author of this library closed the download
1
2611
by: Joel Fireman | last post by:
Help Needed: Upgrade Fedora 4 / Apache 2 to PHP 5.2.x from 5.0.4 I've been testing Joomla as a content manager for the County offices, and it looks pretty good. Unfortunately, I decided to upgrade it from the 1.0.13 version to 1.5 as we get ready to go live with the web site... and the update installation gives an error in XML processing, which seems (from what I've been able to dredge up in forum discussions) to stem from a known bug in...
5
1425
by: oasis | last post by:
HELP NEEDED : I have developed a testing system thats generates question paper. i want to display this paper to 20 different users in a Server/Client architecture. is there any built-in function in oracle that supports this kind of Situstion or how can i distungish between the different computer(IPS) in oracle .
0
8845
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
8743
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
8522
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
7355
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
6177
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
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2745
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1736
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.