|
Hi,
I have to create a form in VB.net that can write records on a mdb file on my website and also retrieve records from it.
I have never done any web programming, so I want to know how I can do it. Are there any sample codes available on the web? or can someone suggest me a book which explains such work.
Thanks and regards,
Neil Ranjan
|
|
|
|
|
There are loads of articles available here on Code Project on using a database and ASP.NET. Alternatively, there's this section[^] on the ASP.NET site (complete with screencasts) that just might help.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I have an application wich adds items to a listview with groups. Then, I want to sort the items within the groups by the header clicked. I've created an icomperer class and works perfect on Windows Vista (development machine). But when I put this on the running machine (Windows XP) this doesn't work, when I click a header it only flickers but doesn't sort. I'm a little shocked, and I don't know what to do.
Thanks in advance for your time.
|
|
|
|
|
Hi,
First of all thanks for your support and time. I have a requirement to implement method level logging and instrumentation for my project.
what this means is , when a method runs , i need to track the time elapsed for the method. This should be happening without developer calling any code.
It should be set up in the framework( i mean i should write some code in framework which will enable logging and instrumentation and log start time and end time and elapsed time for every method in my project.
Any tips??
Thanks
Santhosh
|
|
|
|
|
|
Have a look at Post#[^] - it's an AOP framework for .Net which might be just what you're looking for. I haven't used it in a commercial project, so can't comment on its suitability in real world environments, but from what I've been able to test I have been very impressed.
print "http://www.codeproject.com".toURL().text
Ain't that Groovy?
|
|
|
|
|
This might also be a direction you may want to investigate:
http://www.postsharp.org/[^]
[EDIT- Ha! Martin must have been posting just as I was! He wins ]
|
|
|
|
|
I wonder if anyone can help.
I am upgrading a Windows Application from Visual Studio 2003 to 2005. After running the conversion wizard and changing/rewriting several methods I got the app to compile (already works perfectly in VS 2003)
However when running the project with a Debugger attached in 2005 and I select the open file dialog box which executes the below code I get the error "Current Thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main Function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process.".
The stack trace is shown as
at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner)
at System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner)
at System.Windows.Forms.CommonDialog.ShowDialog()
at Pupil_Accounts_Final_App.frmmain.importbob() in C:\Documents and Settings\*****\My Documents\Visual Studio 2005\*****Accounts App V2 database upgrade\frmmain.vb:line 379
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
So I then went into my puplicMain class which invokes the form (frmmain) where the button is located for calling the code to start the threaded process to call the method to open the dialog and added the SingleThreadAttribute as shown in the main code below, however the same error is still thrown. I then added this attribute to the button click event and the method (again shown below) but again same problem again.
I have been searching about the Web for several hours trying to find a solution however found one similar article which suggested removing all old DLL files in the BIN directory, I tried this still no luck. Does anyone have any idea what my problem could be? MSDN and all my other usual methods of debugging are just not working with this...
Method for open dialog:
STAThreadAttribute() _
Private Sub importpupils_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnimportbob.Click
'starts threading to make program appear faster and optomise performance
Dim t As New Thread(AddressOf importbob)
t.Name = "Import Bob"
importPupilsThread = True
t.Start()
End Sub
<STAThreadAttribute()> _
Public Sub importbob()
'this sub open's a stream reader so bob's master file can be taken into the program
Dim file As FileStream
Dim inputstream As StreamReader
Dim temp As String
Dim item As ListViewItem
Dim i As Integer
open.Filter = "CSV File (*.csv)|*.csv"
If open.ShowDialog = DialogResult.OK Then
Try
file = New FileStream(open.FileName, FileMode.Open)
inputstream = New StreamReader(file)
Catch ex As Exception
MsgBox("A Exception has occured." + vbCrLf + ex.Message)
Exit Sub
End Try
btnimportbob.Enabled = False
Try
Do While inputstream.Peek > -1
temp = inputstream.ReadLine
item = bobslist.Items.Add(temp.Split(",", 11, StringSplitOptions.None)(0))
For i = 1 To 10
item.SubItems.Add(temp.Split(",", 11, StringSplitOptions.None)(i).Trim)
Next
Loop
Catch ex As Exception
MsgBox("A exception has occured. You may have imported the wrong file or the file is corupt" + vbCrLf + ex.Message)
inputstream.Close()
importPupilsThread = False
Exit Sub
End Try
inputstream.Close()
End If
importPupilsThread = False
btnimportseemis.Enabled = True
End Sub
Main entry point to the program publicMain
Module publicmain
Public Const appversion As String = "2.0.0"
Public Const appauthor As String = "*****"
Public Const apptitle As String = "*******"
Public MainForm As frmmain
Public importPupilsThread As Boolean = False
Public importSeemisThread As Boolean = False
Public nextThread As Boolean = False
' Main entry point in to application
' Creates new instance of the main form then shows the dialog
<STAThreadAttribute()> _
Sub Main()
MainForm = New frmmain()
MainForm.ShowDialog()
End Sub
|
|
|
|
|
Hi,
I don't think you can use STAThreadAttributes for that purpose. Here are two possible solutions:
1. do you user interaction before you start the thread;
2. or set Thread.ApartmentState before calling Thread.Start
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc,
Great thanks for your help on this, problem resolved. It would appear that the Thread.ApartmentState method has been depricated by Microsoft however i replaced this by the below before starting the thread and all works great thanks for your help. If this is anyhelp to anyone I have posted the code below.
Private Sub importpupils_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnimportbob.Click
Dim t As New Thread(AddressOf importbob)
t.Name = "Import Bob"
importPupilsThread = True
t.SetApartmentState(ApartmentState.STA)
t.Start()
End Sub
|
|
|
|
|
am study from book MCTS 70-536 the book that by microsoft with orange cover not the black one okay
my problem is ,,, i dont have the SourceCode CD and am at lesson
Serializtion
i have this lab that want me to serialize class called person and i must copy it from the cd and i dont know but really i need somebody to help me to can understand this lab
please someone tell me what i have to do and am just beginner and dont know how to write a class can become same like person
|
|
|
|
|
H.Hemdan wrote: am just beginner and dont know how to write a class
I am quite surpise that you are saying the you are just a beginner and don't know how to write class And you started reading MCTS- 70-536, Which is Microsoft .NET Framework Certificationm Training Kit.
I will suggest you to please buy some beginners books. Go through the Books, done some hands on, then only go for 70-536 Book.
|
|
|
|
|
Hi,
I've got a dll that is registered on a machine using
<br />
regasm /codebase blah.dll
this dll works fine
During an upgrade I copy a new version of the dll over the top (on reboot if locked)
A VB6 App (yes you red that right) then tries to run the dll and on some machines I get an automation error, this doesn't seem to be OS related and I can't find any other common factor between the machines
rerunning
<br />
regasm /codebase blah.dll
fixes the problem
Does anyone know why this might happen, is there some kind of REGASM clean up process that might notice that I deleted the old dll before the new one gets written and unregisters it?
Cheers
Russell
|
|
|
|
|
It may be because you registered the 1st copy of the .DLL with a set of GUIDs that are no longer valid in the second copy of the .DLL. If you are letting Visual Studio generate the GUIDs or are otherwise not specifically generating and assigning them manually, yourself, you can have this kind of problem. All classes and interfaces exposed through COM are done using GUIDs. If these GUIDs changes between revesions of the .DLL, just copying the new .DLL over the top of the old one will break these GUID/class/interface associations.
|
|
|
|
|
Thanks for the reply.
It seems that it's a version numbering issue, the guids are hard coded in the project at the moment, the interfaces are fine. The problems also appear to have happened since we fixed a build script issue that was failing to change the version numbers on build.
So, now i understand why the thing is breaking but now fail to see why it ever works
This should at least be a bit easier to diagnose.
I think I might sleep on it and see what the problem is.
Russell
|
|
|
|
|
I have a split container on the form. On the left panel and right panel I have tree views. I have set the tree view scroll bars to false. When the treeviews increase in size, tthe panels doesn't show any scroll bar even though autoscroll property of the panels are set to true. How can I show the scroll bars of the panel? I need to synchronise both the scroll bars later.
Regards
Surya
|
|
|
|
|
If the Dock property of your TreeView s is set to anything other than DockStyle.None the scrollbars won't show. The TreeViews must extend beyond the bounds of the panels for this to happen.
If this is not the case, then please ignore this post.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Henry for the reply. But I have set DockStyle.Fill for the treeviews. I want to show the scroll bars of the panels. I mean how to extend treeview beyond the bounds of the panel?
Regards
Surya
|
|
|
|
|
Surya Ayyagari wrote: But I have set DockStyle.Fill for the treeviews
That is the problem. DockStyle.Fill 'does exactly what it says on the tin' it will only ever allow the TreeView to exactly fill its containing control. It cannot grow to be larger and therefore the scrollbars are not needed.
As I said in my previous post, the TreeView must be able to extend beyond the bounds of the panel for the ScrollBar s to show up.
You might try setting Dockstyle.Top which, on reflection, should allow them to grow vertically and thence trigger the ScrollBar
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I want to control my window media with Remote control. Now i am using windows Vista. I don't how to write code and which library shall i use ple
|
|
|
|
|
Hi Guys,
I've got a WebBrowser control embedded in my desktop application. This browser loads an HTML registration form from the local host that i manipulate and query with javascript.
I need a way to test whether javascript is enabled from the client side, so that i can prompt the user to enable it. Is there any way to do this?
Regards
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
I went to the msdn website:http://msdn.microsoft.com/en-us/library/system.net.networkinformation.aspx
but looking for help writing the code in VB.
|
|
|
|
|
Do NOT post your questions in multiple forums. Pick the one forum that is the most appropriate to the subject and stick with it.
|
|
|
|
|
I have a Class named "A"
this class inherits from Windows.Forms.PictureBox
"A" has public properties
if we name properites of A as below:
A1
A2
A3
we can set values of A1, A2, A3 and All inherited properties from pictureBox
I create an instance of A in runtime and name it MyA
and then I have a PropertyGrid name Pr1
Pr1.selectedObject = MyA
Pr1 is showing all properties of MyA including all inheritec from PictureBox
I want Pr1 to show only A1,A2 and A3 and hide the rest. how can I do that????
|
|
|
|
|
This is against OOP principals. All properties etc of the base object shold be present in the deriving object.
However, Microsoft do this themselves all the time! The PictureBox is a good example. It has no browsable Text property in the property grid or in the code editor via intellisense, but it's still there as it derives from System.Windows.Forms.Control which has the Text property.
The way to achieve this is to do something like this with properties, events and methods that you don't want to be visible.
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class MyPictureBox : PictureBox
{
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This property is obselete", true)]
public new Color BackColor
{
get { return base.BackColor; }
set { base.BackColor = value; }
}
} This will make the BackColor property 'disappear' IF MyPictureBox is in a seperate assembly. It will not work if in the same assembly, or added as a project reference to another project - it must be a reference to a seperate dll.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|