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
C

Curious 2009

@Curious 2009
About
Posts
28
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How VB2008 set excel sheet header block (not sorting with its column)?
    C Curious 2009

    With VB2008 I am able to create a new Excel sheet as the following:

            Dim conn2 As New OleDbConnection()
            conn2.ConnectionString = m\_sExcelConnection
            conn2.Open()
            Dim cmd As New OleDbCommand()
    
            cmd.Connection = conn2
            cmd.CommandText = "CREATE TABLE Detail (Invoice\_No char(255),CheckIn char(255),CheckOut char(255),"
            cmd.CommandText += "RNum integer,Guest\_Name char(255),Base\_Room\_Charge Decimal,Service\_Charge Decimal,"
            cmd.CommandText += "HEBERGEMENT Decimal,TPS Decimal,TVQ Decimal,Total\_Taxes Decimal,Total\_Charges Decimal,"
            cmd.CommandText += "Total\_Deposit Decimal)"
    
            Try
                cmd.ExecuteNonQuery()
                conn2.Close()
            Catch ex As Exception
                conn2.Close()
            End Try
    

    - However, after I INSERT data into their columns then try to sorting each column, the Header also being sorting - But if I hight-light the Header row and right-click on it then selecting Cell Format --> Protection --> Mask ... then I can sort every column without touching the Headers *) Since the user probably doesn't know how to do like me, I would like to program it automatically with VB ... any one can help? Thanks in-advanced

    Visual Basic algorithms help tutorial question

  • HELP: How to remove the Microsoft.NET Framework error dialog by programming?
    C Curious 2009

    I will try to analyze the error this time, even the application required to continue immediately Thank for the hint

    .NET (Core and Framework) database help csharp c++ dotnet

  • HELP: How to remove the Microsoft.NET Framework error dialog by programming?
    C Curious 2009

    Since the error happen when the application required to continue immediately, so I didn't have time to debug. But as you suggested, I have no choice to do it! - I will wait for it happen again to analyzy it. I will ask for help again if I can't solve it myself Thank for the guideline

    .NET (Core and Framework) database help csharp c++ dotnet

  • HELP: How to remove the Microsoft.NET Framework error dialog by programming?
    C Curious 2009

    Hi, I have a VB application to access a SQL database on the Server (24-hour operation), once a while I do have a Microsoft.NET Framework error dialog pop-up and my application hang-up! 1. I intend to delete this error & re-launch my application over automatically! I do have a VC++ Kill process to remove my application (succesfully remove all other applications) ... but it failed and can't remove this Pop-up dialog! 2. I notify that if I launch the Window Task Manager,when I select in Process tab my application, when I select Terminate/End button ... a new dialog pop-up and I have to select Terminate button one more time ... finally the Microsoft.NET Framework error dialog disappear! Anyone know any application (or link) to perform Step #2 above automatically? Thank to any help :doh:

    .NET (Core and Framework) database help csharp c++ dotnet

  • How I search DataGridView with text column?
    C Curious 2009

    I did copy & it works, I will try to find the command for simple TEXT->VARCHAR change Thank again

    Visual Basic database help sql-server sysadmin question

  • How I search DataGridView with text column?
    C Curious 2009

    You are right & I will do as you suggested! Thank :)

    Visual Basic database help sql-server sysadmin question

  • How I search DataGridView with text column?
    C Curious 2009

    I had mistake to define my SQL Server database table with all columns with TEXT, with my DataGridView the following codes are working fine (it will show every thing with its randome order):

       cmd = New SqlCommand("SELECT \* FROM GuestInfoStore", con)
    
        If con.State = ConnectionState.Closed Then con.Open()
    
        myDA = New SqlDataAdapter(cmd)
        myDataSet = New DataSet()
        myDA.Fill(myDataSet, "MyTable")
    
        DataGridView\_INFO.DataSource = myDataSet.Tables("MyTable").DefaultView
    

    In my table, there is a column FirstName, if I use:

    cmd = New SqlCommand("SELECT * FROM GuestInfoStore ORDER BY FirstName", con)

    I will have an error since SQL can't compare with Text column, but it is too late for me to change FirstName column back to char(50) or so ... can anyone help me on this? Thank in-advanced :doh:

    Visual Basic database help sql-server sysadmin question

  • HELP: I can't verify text column is empty
    C Curious 2009

    It worked! Thanks for a very quick help :) :) :)

    Database database help question

  • HELP: I can't verify text column is empty
    C Curious 2009

    I am using VB 2008 & MS Access database I have a table WebRateList with 2 columns ResFrom and ResTo defined as DateTime, another column WebID defined as Text (allow Null) When I search:

    strSQL = "SELECT * FROM WebRateList WHERE ResFrom < #" & ChkOut & "# AND ResTo > #" & ChkIn & "#"

    Then it showed "It is in this range!" But if I scan the same row with column WebID must be emptied, it didn't get in (infact the WebID is empty)

    strSQL = "SELECT * FROM WebRateList WHERE ResFrom < #" & ChkOut & "# AND ResTo > #" & ChkIn & "# AND WebID = NULL"
    da = New OleDbDataAdapter(strSQL, dbConn)
    dt = New DataTable
    da.Fill(dt)

    If (dt.Rows.Count() > 0) Then
    MsgBox("It is in this range!")
    End If

    Even I defined the following the result is the same

    strSQL = "SELECT * FROM WebRateList WHERE ResFrom < #" & ChkOut & "# AND ResTo > #" & ChkIn & "# AND WebID = '' "

    Anyone can help? :doh:

    Database database help question

  • How I display an increment number on the same web pages (.asp)
    C Curious 2009

    Thanks for the link, it shows as I wanted ;)

    ASP.NET help tutorial question announcement

  • How I display an increment number on the same web pages (.asp)
    C Curious 2009

    I have to display an increment number every second in the same web page (.asp) but I don't know how to do it (refresh or update)? Can anyone help? By the way, I do have a function delay 1 second

    ASP.NET help tutorial question announcement

  • How SQL command queury the first character of a Name column from a MS Access database?
    C Curious 2009

    I did try 'A%' somehow it doesn't work, but if I try with 'A*' like the latter response then it work! Anyway, thank for help just might be syntax from me :)

    Database database help tutorial question

  • How SQL command queury the first character of a Name column from a MS Access database?
    C Curious 2009

    It works beautifully Thanks for help :-D :-D :-D

    Database database help tutorial question

  • How SQL command queury the first character of a Name column from a MS Access database?
    C Curious 2009

    I have a MS Access database with a table INFO that has Name column (only contains First Name), since it contains a huge list, it will require very long time to queury all of them. I prefer to devide them by character groups (A,B,C ... Z) in order to reduce the queury time I couldn't find the the SQL command that can queury table INFO with column Name starting with A character Anyone know how to do it? Thanks to any help :doh:

    Database database help tutorial question

  • Why I can't search SQL database with WHERE with a text variable?
    C Curious 2009

    I re-define Col1 to varchar(50) then use: cmd3.CommandText = "SELECT * FROM GuestInfo WHERE Trial = 'ABC' " Dim lrd As SqlDataReader = cmd3.ExecuteReader() Working as a charm! Thanks :) :) :)

    Database database csharp help question

  • Why I can't search SQL database with WHERE with a text variable?
    C Curious 2009

    I did try as you suggested but now it is weird, the error now shows: Connect to SQL Server, data types text and text are incompatible in the equal to operator - Might be in SQL database, I shouldn't defined Col1 as Text? If YES, what I should define to with Dim str as String in VB.net (str = "ABC"): . varchar(50) . varchar(MAX) . char(10) . nchar(10) . ntext Any suggestion? Meanwhile, I will also search for more solutions :doh:

    Database database csharp help question

  • Why I can't search SQL database with WHERE with a text variable?
    C Curious 2009

    I am using VB.net and I have a SQL database table GuestInfo with 1 column Col1 defined as Text with allow NULL & another column Col2 defined as Int with allow NULL If I use command:

    cmd.CommandText = "SELECT * FROM GuestInfo WHERE Col2 = 12345"
    Dim lrd As SqlDataReader = cmd.ExecuteReader()

    - There is no error happen But if I use:

    cmd.CommandText = "SELECT * FROM GuestInfo WHERE Col1 = 'ABC'"
    Dim lrd As SqlDataReader = cmd.ExecuteReader()

    - There is an error pop-up said that text and varchar are incompatible operator Then I tried the following:

    Dim str As String

    str = "ABC"

    cmd.CommandText = "SELECT * FROM GuestInfo WHERE Col1 = '" & str & "'"
    Dim lrd As SqlDataReader = cmd.ExecuteReader()

    - There is a same error display What can I do to search a Text value in column 1?

    Database database csharp help question

  • I don't know why I have this error
    C Curious 2009

    Then I will try both methods, the latter is just for curiously Thanks & ;)

    Visual Basic help question announcement

  • I don't know why I have this error
    C Curious 2009

    I will use your update codes There is an alternative, but I don't know which one is better regarding of process speed (considering there are many rows existed) 1. I move the update If room_N > 0 Then outside the while loop, in the loop I will put LOOP's str values into a string array, when Loop done ---> lrd.Close() 2. Then I use a While Loop to Update all rows from the array *) This will avoid Open/Connect twice & Close twice ... but might it be a clumsy programming? Thanks for help :)

    Visual Basic help question announcement

  • I don't know why I have this error
    C Curious 2009

    You are right, however my database is already open & connect ... now I have open & connect anothe one with the same database?

    con.ConnectionString = strOpenSQLDatabase
    con.Open()

    con2.ConnectionString = strOpenSQLDatabase
    con2.Open()

    Is there other way around?

    Visual Basic help question announcement
  • Login

  • Don't have an account? Register

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