Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
V

Vaibhav Sharma

@Vaibhav Sharma
About
Posts
7
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • reading a string from a txt file & insert it in a database table?
    V Vaibhav Sharma

    Ok as regards your first qt. >> Use the My.Computer.FileSystem.ReadAllText() function to read the text from the text file that you want the data to be imported from. Dump the string returned by this into a local called importedData >> As for the Database code, you should have specified the provider, but here is it for Access. Dim oledbCn As New System.Data.OledbConnection(connectionString) oledbCn.Open() Dim oledbCmd As New System.Data.OledbCommand(commandString,oledbCn) If oledbCmd.ExecuteNonQuery()>0 Then MessageBox.Show("Data imported to database correctly.") Else MessageBox.Show("Data import failed.") End If As you may be knowing, connectionString for Access will be "Microsoft.Jet.OLEDB.4.0; Data Source=MyDatabase.mdb" commandString would be the T-SQL statement like "INSERT INTO TableName(colName1,colName2,...) VALUES('" & importedData & "',...)" I guess that is fairly a very Beginners job in .NET and you should be having no problems whatsoever using the above snippets. In case of problems always refer back and we will be there for u. Happy Coding :)

    Regards, Vaibhav Sharma

    .NET (Core and Framework) question csharp database

  • Garbage Collector don't joke!
    V Vaibhav Sharma

    I strongly agree with the IDisposable method of disposal then the GC.Collect() as it may just about bring down the performance a bit more. Thanks for displaying both the methods. :)

    Regards, Vaibhav Sharma

    .NET (Core and Framework) csharp visual-studio com performance help

  • details of a exe
    V Vaibhav Sharma

    Hi, Here is the complete snippet for using the FileVersionInfo class. Thought this would be better for displaying a couple of things: 1. How to get the System Directory 2. How to get the file info. (your primary concern) Dim appName As String = Environment.SystemDirectory & "\notepad.exe" Label1.Text = _ "Comments: " & FileVersionInfo.GetVersionInfo(appName).Comments & vbCrLf & _ "Company Name: " & FileVersionInfo.GetVersionInfo(appName).CompanyName.Trim & vbCrLf & _ "File Build Part: " & FileVersionInfo.GetVersionInfo(appName).FileBuildPart.ToString.Trim & vbCrLf & _ "File Description: " & FileVersionInfo.GetVersionInfo(appName).FileDescription.Trim & vbCrLf & _ "Filename: " & FileVersionInfo.GetVersionInfo(appName).FileName.Trim & vbCrLf & _ "File Version: " & FileVersionInfo.GetVersionInfo(appName).FileVersion.Trim & vbCrLf & _ "Internal Name: " & FileVersionInfo.GetVersionInfo(appName).InternalName.Trim & vbCrLf & _ "Is Debug: " & FileVersionInfo.GetVersionInfo(appName).IsDebug.ToString & vbCrLf & _ "Is Patched: " & FileVersionInfo.GetVersionInfo(appName).IsPatched & vbCrLf & _ "Language: " & FileVersionInfo.GetVersionInfo(appName).Language & vbCrLf & _ "Legal Copyright: " & FileVersionInfo.GetVersionInfo(appName).LegalCopyright & vbCrLf & _ "Product Name: " & FileVersionInfo.GetVersionInfo(appName).ProductName & vbCrLf & _ "Product Version: " & FileVersionInfo.GetVersionInfo(appName).ProductVersion & vbCrLf & _ "Special Build: " & FileVersionInfo.GetVersionInfo(appName).LegalTrademarks & vbCrLf & _ "Original Filename: " & FileVersionInfo.GetVersionInfo(appName).OriginalFilename & vbCrLf & _ " Needless to say that there are some more properties." So if you haven't really done a lot then this should help you out. In case i was late in posting (:laugh:as usual) please pardon me. Happy Coding! :)

    Regards, Vaibhav Sharma

    .NET (Core and Framework) announcement

  • How to avoid the .net framework after the installer has been made?
    V Vaibhav Sharma

    Hi, The solution you want is definitely feasible but costly. Yes a .NET application can be deployed to the client machine without installing the complete .NET Framework. Yes and please dont ask me how because i dont have the answer. But someone has the answer and its here: Salamander .NET Linker and Mini Deployment Tool As regards license issues with Microsoft i guess once you reach the above link you will find a key quote given by a Microsoft employee so rest assure it is not anti licensing as far as you are concerned. But then it is not free and you will need to make sure you get it genuinely and it has great benefits by providing inbuilt obfuscation that prevents reverse engineering of .NET MSIL code, the biggest disadvantage of .NET Applications. So best of luck and do reply, eagerly awaiting your comments.

    Regards, Vaibhav Sharma

    .NET (Core and Framework) question csharp dotnet testing beta-testing

  • Memory allocation / GC issues???
    V Vaibhav Sharma

    Hi, I am amazed that after reading all the replies and posts on this article no one mentions of the Using...End Using code block. I am sure you must be knowing it but just a little bit of detailing on the using statements: 'VB Version, C# no different, just lang. changes Using dlgOpen As New OpenFileDialog() dlgOpen.Filter="*.*" 'Any other properties dlg.ShowDialog() End Using Now what the above code fragment does is that the CLR will create the dlgOpen object and will be responsible for its disposal, not YOU. This has serious benefits in terms of Performance & Memory Utilization since as soon as the code execution reaches End Using the dlgOpen will be Disposed off without requiring you to do any thing at all. :::One Catch Though While using the Using statements::: the dlgOpen will not be accessible outside the Using block since its scope is limited is to the Using...End Using block. So i strongly recommend you to go ahead and use the Using...End Using blocks for all the DialogBoxes since most of them times they return only one value which can easily be stored on a local/global variable. Awaiting reply eagerly.

    Regards, Vaibhav Sharma

    .NET (Core and Framework) csharp help c++ performance

  • Font Preview Problem with Fonts not supporting Regular Style
    V Vaibhav Sharma

    Hi, I am on a project of creating handful VS 2005 addins and one of them is an in-built Font Previewer. Now i have done the basic jobs required to fill the list in an enhanced User Drawn Listbox and on SelectedIndexChange_Event i have updated the preview text. The problem comes in when a Font doesnot support FontStyle.Regular In this case i get an exception stating: "Font 'Whatever be its name' doesnot support the FontStyle Regular." So what can you guys suggest. Awaiting responses from all interested. The project is a VB .NET one, but any CLR compliant version would do.

    Regards, Vaibhav Sharma

    Visual Basic csharp dotnet visual-studio help announcement

  • Double Click on Combo Box
    V Vaibhav Sharma

    Hi!, I am not trying to ask you to change the design of your app., but a feasible solution is an Edit button right besides the cboBox so that the user may select the comboBox item and then click on edit to edit the selected record. This way the user is not forced to do any extra thing, since any which way he had to click TWICE to edit/view the record. Hope this helps you out in some way or the other. Happy Programming!!!!

    Vaibhav Sharma...

    Visual Basic help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups