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
S

Sam Horne

@Sam Horne
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • web services
    S Sam Horne

    My suggestion would be to google some free xml files containing that information, and then just using an xmldatasource to bind to your ddl. http://www.google.com.au/search?hl=en&q=xml+list+of+countries&meta=[^]

    ASP.NET wcf

  • handle sql error to stop user reputation
    S Sam Horne

    Instead of relying on exceptions to catch the error, you should just do a database connection yourself selecting the user with the supplied username, if a row is returned, then that username exists. Following code is in VB.NET

    Dim strQuery as string = ""
    strQuery should be where you select * from users where username = username you're trying to test
    Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("mainDBConnection").ConnectionString)
    conn.Open()
    Dim cmd As New SqlCommand(conn.Database & ".dbo." & strQuery, conn)
    Dim dr As SqlDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
    if dr.HasRows = true then
    'DISPLAY ERROR MSG
    end if

    Obviously you'll have to change around specifics like database connection string etc. Hope this helps.

    ASP.NET database performance help question code-review

  • Micosoft Word Interop
    S Sam Horne

    Hi, I'm getting a null reference exception on the following code, which is attempting to create a word document. The error is occuring at 'wordDoc.Activate'. I have Word 2007 installed on both the server and on my machine, but I'm not too sure on how the interop stuff works. If someone can point me in the right direction, that would be great.

    Imports Word = Microsoft.Office.Interop.Word

    ....

    Dim wordApp = New Word.ApplicationClass()
    Dim wordDoc = wordApp.Documents.Add
    wordApp.Visible = True
    wordDoc.Activate()

    wordApp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
    wordApp.Selection.TypeText("Some text")
    wordApp.Selection.TypeParagraph()

    ASP.NET com sysadmin help
  • Login

  • Don't have an account? Register

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