vb

ADO Recordset Decimal value issue

I have code similar to Dim A, B, C Set rs = Server.CreateObject("ADODB.Recordset") strSql = "Exec [dbo].[some_sp] IND" rs.open strSql,CN,3,3 Do While Not rs.EOF 'these columns are returned as decimal(10,2) format A = rs("col1") B = rs("col2") rs.MoveNext Loop C = A + B 'i get type mismatch error here And I used response.write to c...

Column Sequence and the Entity Framework

So, when you bind a collection of Entity objects to a grid component, the grid displays those fields in the sequential order they are found in the SQL Table they came from. This shows that the ordinal position of the fields are associated with their corresponding entity properties... somehow or other. So here is the question: How can ...

ThreadAbortException

this is my button click sub Protected Sub abc_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsavecurrent.Click Try If Not Page.IsValid Then Exit Sub Saveabc() Response.Redirect("abc.aspx") Catch exab As Threading.ThreadAbortException Catch ex As Exception ReportError(ex...

Run a code in given time interval

I would like to run a code every 1 minute ,15 minute etc Is there any better way than following put in the timer control with time interval 1 sec. A c# solution is also ok. If Now.Minute Mod 15 = 0 Then 'run code for 15 min End If If Now.Minute Mod 1 = 0 Then 'run code for 1 min End If ...

Can we detect the laptop battery level using .net?

I would like to detect the laptop battery level so that I can warn of low battery level using my application is it possible in .net ? Thanks in advance. ...

visual basic with oracle (Need Provider oledb for oracle)

Dear sir, can you tell me,how can i add a provider for oracle(Microsoft Provider oledb for oracle).Actually i had Microsoft ODBC for oracle but i want to add a provider above mention. with regards, Ameer ...

regEx replace in Excel with VB

Hello All, I really dislike making Excel Macro's :-( Here is the typical string I am working with: ·         Identify & document site-related constraints and assumptions. I would like to scrub that string to get rid of everything before "Identify"... I wrote a function to take the string and scrub it, here it is: Function d...

Is there a way to find innermost nodes recursively from xml using c# or vb

I have an XML file say <items> <item1> <piece>1300</piece> <itemc>665583</itemc> </item1> <item2> <piece>100</piece> <itemc>665584</itemc> </item2> </items> I am trying to write a c# application to get all the x-path to inner most nodes eg : items/item1/piece items/item1...

Outlook Calendar Macro (copy appointments)

I'm basically trying to figure out how to create a macro in Outlook that allows me to create an appointment with a specific category, that then copies the appointment from the user's local calendar to an Exchange shared calendar (provided it has the right category). Does anyone have a bit more insight into the Outlook object model on ho...

NHibernate, VB.Net, DataSource,DetailView, BoundField,CreateQuery, a Join, how BoundField can reference column?

Basically a reference problem. I have a query that joins two tables together. There is at least one field named the same between the two (for the join). I return an IList and assign it to the datasource of control with bound fields. But It can't find the fields in the rows. Dim myQuery As IQuery = session.CreateQuery("from ...

Unable to cast object of type 'System.Data.DataTable' to type 'System.Data.DataView'.

I need help every time i run this code i get the same error Unable to cast object of type 'System.Data.DataTable' to type 'System.Data.DataView'. the code is Dim plmExcelCon As New System.Data.OleDb.OleDbConnection Dim cmdLoadExcel As System.Data.OleDb.OleDbDataAdapter Dim PrmPathExcelFile As String PrmPathExcelFile =...

Address space of DLLs called from classic ASP

My application consists of a VB6 DLL that is called from ASP. It needs to manage a pool of connections to a (non-standard) database. I implemented this by using a global variable, but this is being reset every 20 minutes due to an ASP setting causing the application to crash. A previous poster said that DLLs in ASP are all created in th...

how do I express the term if x is integer in VBA language ?

Hi , how do I express the term if x is integer in VBA language ? I want to write a code that does something if x is integer and does something else if its not with vba excel. Sub dim() Dim x is Variant 'if x is integer Then 'Else: End Sub ...

Find the current line in a Rich Textbox

I have a rich text box where you can edit java code with a listbox on the side of it that has the line numbers. I want the listbox to scroll with the rich text box so that they line up. How would you get them to scroll as one? ...

access to File on Server

Hello, My web-appliction references to a file that's in the same maindirectory. Dim index_root As String = "luceneindex" but when use declare a directory with the file Dim directory As Lucene.Net.Store.Directory = FSDirectory.GetDirectory(index_root, False) i get an error. i tried "\luceneindex", "\luceneindex", "\maindirectory\luc...

How do I make sure an OptionButton.Value has been chosen

Hi guys, I currently making an Excel VB application. However, I am stuck at the moment. I am trying to make the choice between two OptionButtons compulsory. I tried the code If Me.PWebOption.Value = False & Me.BWebOption = False Then MsgBox "Please choose a type of website" Exit Sub End If But this is not giving me ...

How do I prevent Visual Basic 2008 from automatically indenting namespaces?

Is there a way to prevent this from happening? Namespace testing Public Module TestModule Public testobj As New test End Module End Namespace It is extremely annoying to have to start out two tabs to the right on new code. Is there anyway to disable auto-indenting just for namespace declarations in visual studio 2008? ...

Which function is faster and efficient?

I need to verify if a certain user exist on my asp.net site.I want to know if which of these two functions is more efficient, faster and better compared to each other and why.Thanks in advance! Public Function CheckIfFriendExist(ByVal arg As String) As Boolean Dim alluser As New MembershipUserCollection() alluser = Mem...

Blogs to follow?

What's your list of blogs for anything asp.net and vb.net related. I know for instance Scott Gu's stuff is the first on the rank for asp.net. I'm trying to compile a list of 'good' stuff that will teach me things as I read, the more I gather the better, this way I'll get several posts a day, as most blogs post only once a week if that. ...

WPF - Floating Toolbar

Hi, How can I make a floating toolbar (like the mini font floating toolbar in Word 2007) using WPF? I would like it to appear and disappear from mouse movement over items. Thanks Q ...