vb.net

mvc 2 upload with vb.net

I didn't find any answer on web with vb.net (I find millions of samples with c#) I translated a sample controller to vb.net but doesn't upload My ResimController.vb <AcceptVerbs(HttpVerbs.Post)> Public Function Anasayfa(ByVal forms As FormCollection) As ActionResult Dim errors As Boolean = False If String.IsNullOrEmpty(forms(...

VB.NET Dynamic creation of Details View with a web panel.

Hi, Every time i enter set of values like Group Name,Group Abbreviation,URL in the text boxes and click the save button automatically its saves in the database and for each set of values a new details view has to be generated dynamically with a web panel and the header of the web panel should have the value of Group Name. Example: Gr...

Preparing for "nothing" in VB.NET method

I have this method: Private Sub SetIfNotNull(ByVal input As Object, ByRef destination As Object, ByVal ConversionType As ConversionType) If input IsNot Nothing AndAlso input <> "" Then Select Case ConversionType Case DealerTrackConnection.ConversionType._String destination = input ...

Convert and Print Structure contents to a form in Visual Basic

Hello, I am trying to print the contents of a structure onto a print page in Visual Basic(visual studio 2008). However my for each loop generates a conversion error? Could someone help me figure out whats wrong? Thanks Public Class Form1 Structure IncomeRecord Dim IDVal As Integer Dim HouseholdNum As Integer Dim YearlyInco...

VB.Net Exclamation Point (!)

The following code is designer generated: Me.lblXRay.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) What's the 8.0! mean? ...

Concatenation in a VB.net loop.

I'm not sure how to make concatenate inside a loop in the same way as this: For x As Integer = 1 to 10 Me.Button & x & .top = 0 Next instead of: Me.Button1.top = 0 ... Me.Button10.top = 0 Any suggestions would be much appreciated, Thanks :) ...

How should i handle public properties?

Within my application i have a PUBLIC customer class... Public Class Customer Public Name As String Public Surname As String End Class Then i decided to use LINQ to SQL within my application. After adding the MyDatabase.dbml class, errors showed up since LINQ creates public properties too <Column(Storage:="_Name", DbType:="NV...

For a user control with a listbox, how can I expose the selected item to a parent page?

I have a simple user control which wraps some logic around an AutoCompleteBox. This question could apply to any ItemsControl control like a dropdown or listbox though. <UserControl> <Grid Background="White"> <sdk:AutoCompleteBox Name="myACB" ItemsSource="{Binding myData}" /> </Grid> </UserControl> I want expose the Sel...

Is the 'Overloads' keyword ever required in VB.Net?

As the title says. From what I can see online the Overloads keyword is optional but is there ever a time when it is necessary? It even seems to be an error when used in a Module. ...

Could i mix values from local data with values returned from database while using LINQ to SQL?

I am creating an xml file with LINQ as follows... Public Sub CreateXml() Dim db As New MDataContext Dim Customers = <gallery columns="3" rows="3"> <%= From customer In db.Customers _ Select <customer> <name><%= custo...

How to Attach the Events of an Original Object to a Deep Copied Clone

Following up on my question yesterday to deepcopy an object with events in C# and attach the events of the original object to the Cloned copy is pretty easy, you just set the Event declaration in the Copy = the value in the original. Deep Clone when events are attached How do you do this in VB.Net? (Using .Net 2) I was hoping maybe the...

NullReferenceException on web user control

Hello all! First time posting. :) I'm a pretty new developer so I'm not well versed in common ASP.NET problems. As a test, my boss asked me to convert a (not very critical) ASP.NET site from 1.1 to 4.0. Well, it's not extremely difficult and things are going well so far. However, I've hit a small snag. I keep getting a NullReferenc...

C# Run VB.net Assembly from Bytes

I am using this code, I got it to work fine with any C# assembly that allows it to be ran from memory. Is there anyway I could get it to work with VB.net? private static void RunFromMemory() { try { byte[] bytes; using (WebClient client = new WebClient()) { byte...

Creating a namespace to "import" a database class in vb.net 2005

I need to create a namespace for my database class file, so I can call the database procedures within my webservice module. How can I create a namespace to call that Db class file? ...

Detect 404 without catching exceptions

Simple function: Check if a webserver returns a non-200 HTTP status. Private Function RemoteFileOk(ByVal Url As String) As Boolean Dim req As HttpWebRequest = TryCast(WebRequest.Create(Url), HttpWebRequest) req.Method = "HEAD" Dim rsp As HttpWebResponse = TryCast(req.GetResponse(), HttpWebResponse) Return (rsp.StatusCode = Http...

Cannot assign LINQ query to variable

I want to declare a variable to hold the query result from LINQ to SQL like to the following: Dim query As IQueryable(Of Student) If isNoUserName Then query = From st In db.Students _ Order By st.AssignedId Ascending _ Where (st.studentId = studentId _ Select st Else...

POI: Cell format for 2000 and above records is corrupted

Can anyone help me on how can I fix this one. I'm using vb.net 2003 and I've tried to generate a report in Excel using POI, but I have a problem when the records is above 2000, cell formats has been missing or corrupted for the next 2000 and above records. And when I'm opening the generated report and It shows a message of "To many diff...

Help with appending text file VBA Express

Hi, Can anybody tell me how to create a Form in VBA that has two text boxes that when filled append a text file. Lets say that the user types CHICKENS in textbox1 and EGGS in textbox2 then I want a sentence generated in the associated .txt file that says: Don’t count your CHICKENS before your EGGS hatch. Then if the user would decide...

Problem generating manifest in VB.NET 2005

Hi, I am using source safe to maintaine my code. Recently I copied my code to another machine. But everytime i build my project i am getting below error: Problem generating manifest. Could not load file or assembly 'D:\WorkingFolder\Project\SubFolder\obj\Release\SubFolder.exe.manifest' or one of its dependencies. An attempt was made t...

SQL Command cannot be converted to string

Here's my code I seem to be getting an error SQL command cannot be converted to string with this code Dim LogData2 As sterm.markdata = New sterm.markdata() Dim query As New SqlCommand("Select * from openquery (db, 'SELECT * FROM table WHERE person=@person')") query.Parameters.AddWithValue("@person", Session("number")) Dim drCode2a A...