Equivalent Of "extern Alias" (C#) In VB?
Nov 24, 2008Is there an equivalent of "extern alias" (C#) in VB.NET ?
View 1 RepliesIs there an equivalent of "extern alias" (C#) in VB.NET ?
View 1 RepliesI am using a sql server database and i am storing the time value in the datetime variable. I am developing a booking system application in vb.net. When I want to view already made bookings using datagridview and by implementing dataadapter and dataset...When the table is shown in the datagridview I want custom column names to be shown so tell me that how can i use alias in the query given in datadapter initialization part?
View 1 RepliesI have an enum in one module that's used in another that has a long name:
Public Enum Enumwithaverylongname
foo
bar
end Enum
When I use it, I'd like to alias it to a shorter name like:
f.foo
instead of
Enumwithaverylongname.foo
Can I do that?
Here's my SQL query:
SELECT EmployeeID, EmployeeLastName + ', ' + EmployeeFirstName AS Name
FROM employees
ORDER BY Name
How can I go about doing the something in LINQ to SQL?
I have an object and I iterate over object's properties. Foreach property, i append it as a column to a listview.
In my object, some properties doesn't have accents. But in portuguese, they do. For example: "Endereco" property must be "Endereo".
I need an away to create an alias to the properties.
I'm writing custom code in VS2005 Reports (SSRS / Report Builder). The code is working fine, but I have to make absolute references to assembly classes. For instance:For Each m As System.Text.RegularExpressions.Match In ...Is there any way to alias the reference to System.Text.RegularExpressions.Match, so that I can reuse it in a concise manner? I know in PHP, you'd do it like this:
use MyNamespace\MySubNamespace\MyClassVerboseName as MyClass
[...]
MyClass->MyMethod();
[code]......
doesn't really matter? low priority.
[Code]...
I am assigning the class object to grid's data source. And grid displaying all the properties of class with values. But i do not want to display the original name of properties of class. Is there any way to provide set alias name to property to display in grid?
I know that it can be possible by setting the grid's column caption. But i want to do it at class level or by other way instead of processing on Grid. Is there any attribute that set alias name to property?
I have some VB6 code that I am converting to VB.net and came across this section
Declare Function TmSendByLen Lib "tmctl.dll" Alias "TmSendByLength"(ByVal id As Integer, ByRef msg As Any, ByVal blen As Integer) As Integer
'snip'
[code]....
I have not come across the Alias term before but I can guess what it does. What I am unsure of is the reasoning behind overloading the alias. If that is what is happening.I need to create overloads for the TmSendByLen function as the 'As Any' is not supported in VB.net so I am not sure if I should just remove the alias or if I should leave it in place.
Using .NET (VB or C#), how can I add an e-mail alias to a user in Active Directory? I have written code to change the format of our usernames from "first_last" to "first.last.country" and I need to update the e-mail addresses as well. Our solution is to add an alias e-mail to the users in exchange, but I don't know how I can do this using .NET.
View 1 RepliesIn Reporting Service, I need to have a vertical, starting at bottom, bottom-to-top, horizontally middle aligned text.The only way to do this is to create an image in code, and set this image into the title column.See the code below.Basically, it works fine, just that the anti-alias quality is pretty crappy.Is there anything I can do to improve it ?The vertical text is somehow pale, and not full black, and also there is smearing all around the text, in the background color.As well as it appears bolder than the text on the left, but both have format arial, size 8, bold I've tried all other values of System.Drawing.Text.TextRenderingHint.*, as well as no anti-alias at all but the current one seems to be the least crappy.I've also tried to change the image format, to no avail:
Function LoadImage2(ByVal sImageText As String, ByVal sImageTextMax As String) As System.Drawing.Image
sImageTextMax = sImageTextMax.PadRight(15)
Dim iFontSize As Integer = 8 '//Change this as needed
[code]....
How might one go about aliasing a type in VB.NET or C# such that when the alias is used as an argument type in a function, accidentally using the not aliased type is an error?
i.e.
Imports AccessSpecifier = System.String
Module Accessors
Delegate Function IoOper(ByRef strm As System.IO.Stream) As Action
[code]....
Overall, I'm wanting the IDE to force me to know what I'm doing if I'm throwing Ints around to mean Flags, or States and Strings around to mean Names, Propertys and Records.
I'm trying to get the Alias of the logged in user (Active Directory/LDAP environment/Exchange) .
View 8 RepliesI am using a databound datagridview control. I created a custom query to fill the grid with which includes joins and using alias names in the sql query for the joined fields. Here is the query I am using:
SELECT Events.[Date], Events.[Time], Contacts.LastName AS Lastname, Contacts.FirstName AS Firstname
FROM (Events INNER JOIN
Contacts ON Events.ContactID = Contacts.ContactID)
The datagrid views fine using the columns that are in the events table. I want to be able to view the aliased columns from the contacts table in the datagridview as well.
How can I display the joined columns in the datagridview? Maybe there is a better way to do this? Maybe this is not enough information for a resolution.
I'm using Redumption to send a mail using VB.NET, I've stored a file with an unique name exg.c:docs123.pdf which I'm supposed to attach to the mail with a different name "Appliaction.pdf".
[Code]...
I am using a query in vb.net, database is Access. I need alias of query like sql but the query return me column alias and also ' '
SELECT COLUMN1 AS 'FIRST NAME'
I expect the result to be a field called FIRST NAME but it returns the string "FIRST NAME". Is there is any way if return me the field FIRST NAME instead of "FIRST NAME".
im trying to join two tables together, (this messaging system) and im having trouble with the query.
Select Message_ID, Firstname, Surname , Subject , Message FROM messages, guardian_users INNER JOIN messages ON guardian_users.User_ID = messages.Sender_ID WHERE messages.receiver_ID = 3
and im getting this error: #1066 - Not unique table/alias: 'Messages' (joining tables Messages and guardian_users)
I know you can alias an Imports statement in
Imports xyz = ProjectABC.ClassABC
But if I want to use the Project Properties, Reference tab to select a namespace to allow a project-wide setting, is it possible to alias that namespace?
I know that AndAlso is equivalent to && and OrElse is equivalent to ||. But what is the cleanest way to achieve the equivalent of Visual Basic's And and Or in C#?For example, consider the following VB.NET code.The ValidateForControl method performs some validation and returns whether the state of the specified control is valid. The entire input form is valid if all controls are valid. However, each control must be individually validated even if one is invalid (which requires the operator not to short-circuit). Visual Basic's And operator is perfect for this situation, but unfortunately there's no equivalent operator in C# as far as I know (&& short-circuits).
[Code]...
I am Validating a TextBox on it's KeyPress Event in VB.
VB.Net
If InStr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`~!@#$%^&*()_+|[]{};:<>/?,.'" & """" & Chr(8), Chr(KeyAscii)) = 0 Then KeyAscii = 0
What will be it's equivalent in C# ?
Let me know how can i use this Err in c#.This is VB Code:
If Len(sPart1) <> PART1_LENGTH Then
Err.Raise(vbObjectError, , "Part 1 must be " & PART1_LENGTH)
[code]......
What I am trying to do is to check if a value matches one of two numbers (and easily be able to add to the numbers to compare to). Rather than doing a longer-winded way such as: [Code] I have found that this only works when SectionID is 2 or PageID is 8. If SectionID is 3 or PageID is 12 then it doesn't work. Why is this and what can I do to try to get around the problem?
View 3 Replieswhat is the equivalent for OLE in .net
View 1 RepliesI'm normally at home in C#, and I'm looking at a performance issue in some VB.Net code -- I want to be able to compare something to the default value for a type (kind like C#'s default keyword).
[Code]...
I am relatively new to Visual Basic. When it comes to logging, in Java I use log4j for logging.What is the equivalent in Visual Basic and can you please guide me to a good tutorial?
View 1 Repliesprivate bool txtRegExStringIsValid(string textToValidate)
{
Regex TheRegExpression;
string TheTextToValidate;
[code]....
I've got a large codebase which I'd like to expose to plugin authors to allow them to use VB.Net Express to code plugins for a server app, which is not available to them. My problem is that even with obfuscation, I'd rather not distribute the complete app and/or dlls, as even with obfuscation peeling apart a .NET assembly and puzzling out code is relatively easy to do. I'm interested in this because the licensor I obtain the code from requires me to protect IP and assets and while distributing .NET apps opens up the app to disassembly, keeping the server app private and allowing users to utilize a skeleton dll to code against is a happy medium.
What I'm looking for is some way or a utility to go through my server app source code and create a codeless version of the app which only contains method and property signatures.The intent is to provide a stub .NET dll for them to add as a reference and code against as if they were directly interacting with the server, without actually providing the server code to them, compiled or not. I can of course do this by hand but there are over 90 classes and hundreds of thousands of lines of code I'd rather not spend a week hand tweaking. Also, this presents a problem whenever new methods or code are added to the project. Finally, two separate projects is an even worse scenario.Because people will post suggestions that have little or nothing to do with the question, here's a short, clear example. I want to turn this class:
Public Class MyServer
Public ReadOnly Property Name() As String
Get
Return "Whatever"
[code].....
What is the vb.net expression of this c# expression ?
Frame.GetController<ShowNavigationItemController>().CustomShowNavigationItem += new EventHandler<CustomShowNavigationItemEventArgs>(WindowController1_CustomShowNavigationItem);
I'm looking at some old ASP code that contains the following:
Set objDSE = GetObject("LDAP://RootDSE")
Set objSysInfo = CreateObject("adsysteminfo")
Set objUser= Getobject("LDAP://" & Replace(objSysInfo.UserName,"/","/"))
dtmValue = objUser.PasswordLastChanged
[code]....
This is for an intranet app that uses integrated authentication. Is there a replacement for the ASP adsysteinfo object? I can probably port most of the LDAP calls using System.DirectoryServices.DirectoryEntry, but is there a better/easier way to do this in ASP.NET (VB.Net or C#)? how to convert the ASP object properties to DirectoryEntry properties?
I have made an application in vb6 abd now trying to do the same in visual studio 2005. In vb6 i was using MSFlexgrid and its .Textmatrix properties. Would like to know what is the .Texmatrix equivalent for .net. When i pasted the code form vb6 i get the following error...
'TextMatrix' is not a member of 'AxMSFlexGridLib.AxMSFlexGrid'