Currently, whenever I pass a string to the db, if that string is empty, then i set that object to NULL by doing the following:
IIf(DescriptionTxt.Text.length > 0, DescriptionTxt.Text, DBNull.Value)
I was thinking about writing a function to reduce the length of this code, and make it more consistent.
However, I was wondering, is ther...
I'm automating some outlook functionality in a .NET app. It works great. I am compiling it and using v 12.0.0.0 of the Outlook Interop assembly.
My code should work on any version of Outlook so it seems silly to have to bind it to a specific version.
Is it possible to use reflection to do this instead of compiling a reference?
A...
I have the following code in child window which is working but what I want to do is instead of using response.write I want to use label control or to display all the filename like this:
music.pdf, inventory.doc
My Ultimate goal is to pass the values in string (e.g.: "music.pdf, inventory.pdf" ) to the parent window.
How do I do it?
...
The below is a snippet from VB that I am porting to a C# rewrite. My question is what is receipt_date after the assignment? Is it still an object or is it a string?
Dim receipt_date As Object
receipt_date = CType(dr.Item("RECTDT"), String)
Would this be the correct C# counterpart?
object receipt_date;
receipt_date = dr["RECTDT"].To...
I've got a method I'm trying to translate from c# to vb, goes something like this ..
x.For(typeof(IRepository<>)).Use(typeof(Repository<>));
VB doesn't seem to like the idea of a IRepository(Of ) ... what's the syntax on that?
...
In the 2nd step of the wizard, I have a dropdownlist that is populated from the db. when I go to the 3rd step RegisterUser.ActiveStepChanged event if fired. In there I save the data to the db. My textboxes are saving properly but my the vb code isn't pulling the selectedIndex/Value from the dropdown.
I tried populating the dropdown in Lo...
From the documentation:
The CTypeDynamic method applies dynamic conversions in accordance with the conversion semantics defined by the object itself. If a dynamic object inherits from DynamicObject, the CTypeDynamic method first attempts to perform the conversion by using a user-defined, static conversion. If the user-defined, static...
I'm trying to convert some functions written in JScript to VB.NET (I'm porting a classic ASP page to ASP.NET) and having issues as I'm not very familiar with JScript. I'm having issues with converting even the function declaration properly in VB.NET. In my converted code VS2008 is giving me an error saying "Array bounds can not be specif...
Does anyone have a complete list of the conversion operators for VB/C# and how they differ?
So far I know about...
value as type [C#]
TryCast(value, type) [VB]
Convert.ToXxx(value) [any]
(type)value [C#]
CType(value, type) [VB]
DirectCast(value, type) [VB]
CXxx(value) [VB]
CTypeDynamic [any]
implicit conversions when using Option Stri...
I have recently begun working at a company wherein there are very few (2-3) programmers and many more engineers. As a result, the default language of choice has become VB.net. I look at some of the math-intensive portions of the programs that have been written thus far and I'm certain that these portions could be improved considerably if...
OK I am new to .net, I am just taking a shot in the dark through this whole thing. I have an Addresses table with a StateID and CountryID field. They refer to the States and Countries table. I am using LINQ to SQL and Visual Studio 2010.
In my AddressesController I have:
Function Create() As ActionResult
Dim these_states =...
I am currently painting a light blue, partly transparent overlay over owner-drawn objects to indicate certain state. It's OK but I thought that it would be even nicer if I could at some sort of glass effect to further establish the idea that the particular object has "something" overlaid over the top of it.
I thought that some glass str...
Hi
I have an app with 24 different Forms. They have some security options based on which the 5 different buttons Submit, Approve, 2nd Approve, 3rd Approve, Reject etc get enabled disabled.
Now I designed a MainForm that has all the buttons and the security code for them. I have created eachform as a usercontrol and load them dynamical...
With my new client which is linked with an IP Board forum. Once they log into the client the people who donated or bought VIP on my forums will have access to all my applications I have made. It will most likely show a list of all my applications in a listbox/listview.
I currently do not have the code to be able to do this nor do I know...
I'm trying to write out animals from a database. All the samples I see for creating View pages have hard-coded "nodes" in the URLs. I can get my first view to work but my second one doesn't write out the correct URL to go to the third one. So, for example, I want my URLs to be:
/animals/
/animals/canines/
/animals/canines/schnauze...
I have to query once an hour to a remote web server to recieve data. However the remote web site does not use web services and state in thier 300+ page document that:
Although SOAP is a recognized Web Services API, the RTO web server does not offer a web services
interface. That is, there is no Web Services Description Language (WSDL) ...
Hello all,
This is my first post to stackoverflow, so bear with me. :)
I am developing a winforms application that will have an offline mode, so that it can access the data if an internet connection (or more accurately, a connection to my WCF service) cannot be established. I have decided to utilize SQL Server Compact edition on the c...
Hello,
I am trying to fetch the name of the textbox my cursor is currently in or over in a Google chrome browser window. Is this possible? And if so, how would I go about doing it.
Thanks!
...
I am trying to distinct on multiple columns and get datarows from datatable. but getting error.
Dim query As IEnumerable(Of DataRow) =
(From row As DataRow In SourceTable.AsEnumerable() _
Select row.Field(Of String)("ColumnName1"),
row.Field(Of String)("ColumnName2") ).Distinct()
below e...
why use of namespace and use keyword and declaration of namespace
...