473,326 Members | 2,133 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,326 software developers and data experts.

Namespace and Import woes

I have a .Net 2.0 project called MyProj. I use VB.

In my appcode folder I have a .vb file (module1.vb) with different
functions I call from my forms (aspx-pages).

Module1.vb starts with some Imports and then
Namespace MyProj

and then comes the functions:
Public function AA()

In my forms CBF's I have
Partial Class frmYYY
Private sub Page_load......
X=MyProj.AA() ' because I put MyProj in front og AA it can locate AA

or, I can have
Namespace MyProj
and then
X=AA() ' without MyProj in front.

In one of my forms I have Imports MyProj instead.
And hten I dont need Namespace or putting MyProj in front of AA.

That looks good, so I wanted to do that in the other CBFs.
Removing the Namespace - line.

But it doesn't work?

If it says Me.OneControl.text=AA()
and I remove the Namespace - line, squiglys appear under the line.
If I put Imports MyProj the squiglys disappear from under AA, but
Me.OneControl squifly says: 'OneControl' is not a member of 'frmYYY'

Explanations ?

/jim

Jeg har et .Net 2.0 projekt der hedder MyProj. Jeg bruger VB.
I mit appcode bibliotek har jeg så en .vb fil (module1.vb) med en masse
forskellige funktioner jeg kalder inde fra mine formularer (aspx-sider).

Module1.vb starter med et par Imports og så
Namespace MyProj

og så kommer funktionerne fx
Public function AA()

I mine formularers CBFere kan jeg så skrive
Partial Class frmYYY
Private sub Page_load......
X=MyProj.AA() 'fordi jeg skriver MyProj foran AA kan den finde AA

eller jeg kan starte med at skrive
Namespace MyProj
og så ellers
X=AA() ' altså uden MyProj foran.

I én af formularerne har jeg istedet Imports MyProj
Og så behøves ikke namespace, og ejheller at skrive MyProj foran AA.

Det tiltalte min æstetiske sans, så det ville jeg også gøre i de andre
CBF'ere.
Altså fjerne den Namespace - linje
Men dér virker det ikke?
Hvis der står Me.EnKontrol.text=AA()
og jeg så fjerne Namespace - linjen, kommer der squiglys under hele linjen.
Hvis jeg så skriver Imports MyProj forsvinder squiglys under AA, men
Me.EnKontrol'en siger: 'EnKontrol' is not a member of 'frmYYY'

Hvad gør jeg galt ?

/jim
Aug 29 '06 #1
0 931

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

Similar topics

2
by: Fritz Bosch | last post by:
Hi experts Is is possible to import/manipulate a module such that I can supply its __dict__? I want to supply my own dict subclass object to be filled by the import, e.g. a class like: >>>...
1
by: Steve George | last post by:
Hi, I have a scenario where I have a master schema that defines a number of complex and simple types. I then have a number of other schemas (with different namespaces) where I would like to reuse...
2
by: Stanimir Stamenkov | last post by:
I'm trying to find out if it is permissible to include a schema document with absent target namespace to a schema with specified target namespace, and if it is, what are the rules to resolve the...
2
by: Dale Anderson | last post by:
I have a schema that I'm trying to read. The schema has an element named 'GrantApplication' and one with a namespace prefix named 'SF424:GrantApplication'. When I try to read this schema in, I...
29
by: Natan | last post by:
When you create and aspx page, this is generated by default: using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Text; using...
4
by: Kevin Newman | last post by:
The primary problem I've had with php is the lack of namespaces, which makes OOP very difficult to organize, since you end up with large number of classes cluttering up the same namespace - which...
18
by: jacksu | last post by:
I have a simple program to run xpath with xerces 1_2_7 XPathFactory factory = XPathFactory.newInstance(); XPath xPath = factory.newXPath(); XPathExpression xp = xPath.compile(strXpr);...
3
by: Chris | last post by:
Hi, 1) In file test.aspx, i put: <%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %> <%@ import namespace="System.Data"%> <%@ import...
3
by: tshad | last post by:
I have a file that I converted from VB.Net to C# that works fine in VB.Net when I compile but not in C# using the same libraries. The error I am getting is: PageInit.cs(9,7): error CS0138: A...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
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...
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
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...

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.