|
I just made a simple application with two reports where first one uses dataset and second one connects directly to database. Second one works much faster! (
|
|
|
|
|
I have a ASP.net application written in VB.Net which is the main application. I have another ASP.net application written in C#. I want to integrate the C# project files into the VB.net project ( without having to convert C# code to VB.net ) . The C# project contains few aspx pages and couple of C# utility classes.
What would be the best way to integrate the C# files into VB.net project and run these successfully within the VB.net app?
Thanks
Madhuri Mittal
|
|
|
|
|
The short answer is that you can't have C# files in a VB.NET project.
I'd recommend either writing your C# into VB.NET for inclusion in the VB.NET proj, or componentise the C# code into a .dll that you can reference from the VB.NET proj.
You could also expose the C# code as a webservice. It all depends on what the aspx C# files do.
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG picture :: my first abstract photo
|
|
|
|
|
SimonS wrote:
The short answer is that you can't have C# files in a VB.NET project
uhh, no. Actually you misread his question. No you can't have vb files in a windows or console application but YES you can inside a web application You just redirect the file pointer at the top of the aspx page,
You can have many different files including java files in there. Although .net transforms it into J# and is utterly useless with J2EE at that point.
Just go to add existing item and add the code behind. Then at the top of your asp page change the finlename it points to and thats all there is to it.
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I have a ASP.net application written in VB.Net which is the main application. I have another ASP.net application written in C#. I want to integrate the C# project files into the VB.net project ( without having to convert C# code to VB.net ) . The C# project contains few aspx pages and couple of C# utility classes.
What would be the best way to integrate the C# files into VB.net project and run these successfully within the VB.net app?
Thanks
Madhuri Mittal
|
|
|
|
|
just add the cs file and the top of the aspx page redirect it to that file
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Hashtable approval = new Hashtable();
//then I added some keys to it and set the value to ""
//I need to set its value to "" again by below foreach
foreach( object obj in approval.Keys )
{
approval[obj] = "";
}
//But it said that "Collection was modified; enumeration operation may not execute."
//Pls help me to make this possible. Thanks a lot for your attention.
|
|
|
|
|
MSDN - foreach:
The foreach statement is used to iterate through the collection to get the desired information, but should not be used to change the contents of the collection to avoid unpredictable side effects.
MSDN - Hashtable.Keys Property:
The returned ICollection is not a static copy; instead, the ICollection refers back to the keys in the original Hashtable. Therefore, changes to the Hashtable continue to be reflected in the ICollection.
An alternative approach could looke like this:
Hashtable ht = new Hashtable();
ht.Add("one", 1);
ht.Add("two", 2);
ht.Add("three", 3);
ht.Add("four", 4);
ICollection keys = ht.Keys;
object[] copiedKeys = new object[keys.Count];
keys.CopyTo(copiedKeys, 0);
foreach(object key in copiedKeys)
{
ht[key] = "";
}
Alexandre Kojevnikov
MCAD charter member
Leuven, Belgium
|
|
|
|
|
Thanks a lot. It is a good idea.
|
|
|
|
|
I need access to the parallel port, but as far as I can tell it isn't possible.
But, in c/c++ it's really easy...
Now, I want my application to be in C#... so would I be able to make c or c++ library and be able to use it in my C# app?
I already tried the NTPort library. But it costs money and it has alot of features I don't even use in it...
I have no clue how they get it to work...
So, is a C/C++ library (DLL) possible? Or, is it just possible to do it straight though C# in some werid way I haven't found???
/\ |_ E X E GG
|
|
|
|
|
Yes you can use C++ functions from C# as long as they are exported from your C++ DLL.
The function prototype in C# will look like this:
[DllImport("my.dll")]
public static extern int MyFunction(string param1, int param2);
You can check this MSDN arcticle for details:
Consuming Unmanaged DLL Functions[^]
Alexandre Kojevnikov
MCAD charter member
Leuven, Belgium
|
|
|
|
|
Ok, thanks.
I'll look into it.
/\ |_ E X E GG
|
|
|
|
|
|
how to write any string into bottom of ActiveDocument in Add-in Project??
somebody can help me?? please!!!
Thanks
Nho'c Ti`
|
|
|
|
|
Hi Guys & Girls,
Just want to know if any of you have had issues with using the axWebBrowser control in VS2003. When I place this control on a tabpage that does not have focus when the form loads the axWebBrowser control does not repaint. It causes a blank area on the screen.
Any ideas what this could be? I'm totally screwed over by this one.
modified 30-Aug-22 21:01pm.
|
|
|
|
|
Do you navigate the WebBrowser to any page in the form's load event? If you don't it wont actually do anything. Try this:
Object obj = null;
axWebBrowser1.Navigate ("http://www.codeproject.com", &obj, &obj, &obj, &obj);
- monrobot13
|
|
|
|
|
I know that in C# you can't directly inherit from two different base classes...
(1) (2)
\ /
\ /
(New Class)
but can you indirectly inherit from two different base classes?
(1) (2)
\ /
\ /
(3)
|
(New Class)
I'm wanting to have the same base class for both forms and controls.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Based on your own diagrams, if scenario 1 isn't possible, then scenario 2 couldn't be.
While you cannot have multiple inheritance in c#, your classes can implement as many Interfaces as you like. It's sometimes limiting, but also essential given the object structure of .Net, and the type-safe system it uses.
What are the two classes you'd like to derive from? Is there any way you can merge them into one bigger class that could be inherited from? If you just need to knwo that certain methods or properties ar available in each of your classes, have you looked into implementing an Interface?
|
|
|
|
|
you couldn't do either of those. The best you could do would be:
(1)
|
|
(2)
|
|
(new class)
or
(1) (I2)
\ /
\ /
\/
(new class)
|
|
|
|
|
wow, don't know what I was thinking there. My old arch enemy "spaces and formatting".
Hopefully you get the gist of it though. You have to inherit straight down with no branches. You could use interfaces, and have as many as you wanted, but then again that's not quite the same as inheriting is it.
|
|
|
|
|
hi all, somebody can help me to do this
how to search SQL Server in my LAN with C# ???
Thanks !!!
Nho'c Ti`
|
|
|
|
|
This is a very broad question. What exactly are you trying to do?
- query a SQL server?
- find all available SQL servers?
|
|
|
|
|
yes, I want find all SQL Server avariable in my LAN
Nho'c Ti`
|
|
|
|
|
You can use SQL-DMO for this: Application.ListAvailableSQLServers()
Alexandre Kojevnikov
MCAD charter member
Leuven, Belgium
|
|
|
|
|