Guest Book

15 Responses to “Guest Book”

  1. Pradeep Says:

    Welcome to my guest book!

  2. sharath Says:

    thanks

  3. HellBond0007 James Bond of Hell Says:

    he he

  4. Nitin Says:

    Hey Pradeep,

    I need a solution to a problem and I guess you’ll be able to crack it. Any help is appreciated.

    I get this error when I run my VB Program.

    “The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.”

    •What my program should do is
    1) User inputs text into a text box and hits the search button.
    2) Result is populated into the GridView (Access database is being used). Result being – Contains the entered term in a string.

    Code:
    Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
    Dim dtATG As New DataTable() ‘ Create New Datatable
    dbDataAdapter = New OleDbDataAdapter ( “SELECT FROM ATG WHERE Term Like ‘*” & (TextBox1.Text) & “*'”, _ ConnectString)
    dbDataAdapter.Fill(dtATG)
    DataGrid1.DataSource = dtATG
    End Sub
    End Class

    • pradeep1210 Says:

      The correct statement should probably be
      “SELECT * FROM ATG WHERE Term Like ‘%” & (TextBox1.Text) & “%’”

      If that doesn’t work, replace % with asterisk (*) and retry.

      • Nitin Says:

        Hey Pradeep, I tried both the options.

        However I get an error pointing to
        dbDataAdapter.Fill(dtATG)

        Error:
        OleDbException was unhandeled
        “The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.”

        Any solutions to crack this?

        Thanks for your help!

  5. Nitin Says:

    Hey Pradeep,
    I tried this and it works. Thanks!

    SELECT * FROM ATG WHERE Term LIKE ‘%” & ContainsTextBox1.Text & “%’.

    Right now I have 5 textboxes and when I leave either one of them empty I dont get any results in the grid. Any soultions to this? Has it got to do something with ‘null’

    • pradeep1210 Says:

      The answer is easy but it looks like it would be a long discussion and spoils the purpose of a guestbook.
      Forums are more appropriate for such Q/A & discussions.
      Can you please create a thread here and PM me a link to the thread? VB Forums (VB.NET section)
      Me or anyone else there would be glad to help you out with your problems. My user handle on that forum is pradeep1210

  6. Dan M Says:

    Hey Pradeep, where can I send you an email?

    Keep up the good work!

    Dan

  7. Mark Lynch Says:

    Hey pradeep,

    I was hoping you could help me, I need to run a console app when clicking a button in a form and need it to write the output into a .xml file, not sure of the best way to do this.

    Also i need to replace a line of text in the file created that is always the same as the output while is formatted for xml does not have the xml opener at the top.

    This is the code i have so far which will run the app with the arguements need.

    Any chance you could help me?

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    Dim process1 As New Process()
    process1.StartInfo.UseShellExecute = False
    process1.StartInfo.FileName = “app.exe”
    process1.StartInfo.Arguments = “-x a default.ext”
    process1.StartInfo.CreateNoWindow = False
    process1.StartInfo.RedirectStandardOutput = True
    process1.Start()
    process1.StandardOutput.ReadToEnd()
    process1.WaitForExit()
    process1.Close()
    End Sub

  8. Umesh NS Says:

    Hi Pradeep,

    I have been using your query Executing a set of SQL Script Files (*.sql) on a Group of SQL Server Databases in my production environment since a month recently i found out that if we omit
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    in a stored procedure the and execute your script SET QUOTED IDENTIFIER is turning OFF
    can u plz let me know where i have to modify to make the old settings as it is?

    Many Thanks for your query it is saving lot of my time

    • pradeep1210 Says:

      I haven’t tested but my best bet would be modifying line #34 as follows:

      UPDATE @FileList SET Command = 'SET ANSI_NULLS ON; SET QUOTED_IDENTIFIER ON; sqlcmd -S ' + @ServerName
      ...

      Let me know if this works (or doesn’t work).

      • Umesh NS Says:

        Thanks for your response Pradeep, it’s not working

        UPDATE @FileList SET Command = ‘SET ANSI_NULLS ON; SET QUOTED_IDENTIFIER ON,sqlcmd -S ‘ + @ServerName
        + ‘ -d %DATABASE% -i “‘ + @ScriptFilesDir + FileName
        + ‘” >> ‘ + @ScriptFilesDir + ‘Output.txt’

        (update statement looks like above)
        there are several Procedures kept in a folder without mentioning SET ANSI_NULLS ON
        GO
        SET QUOTED_IDENTIFIER ON
        in old procedure QUOTED_IDENTIFIER is ON in updated procedure the QUOTED_IDENTIFIER is OFF


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: