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
R

rahvyn6

@rahvyn6
About
Posts
40
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • VB.NET 2005 ODBCCommand
    R rahvyn6

    I dont think that cmd.DeriveParameters is a valid statement in vb.net, at least not for an OdbcCommand. I thought about the try-catch, just reports the same error, "Syntax Error". I really hate FoxPro...

    And now, adding color, a group of anonymous Latin American meat packing glitterati

    Visual Basic question announcement csharp database

  • VB.NET 2005 ODBCCommand
    R rahvyn6

    Hi All; I'm writing a small app that is displaying information in a datagridview from a FoxPro table. I am having issues on the update side of things. I am trying to write my own update statements using the ODBCCommand object, and parameters. However, the statement is failing, with only the message of Syntax Error. When I try to get the actual command text, it shows the sql statement with the @VarName placeholders. Is there anyway to get the final sql statement? Or should it show as the command text, and I am setting this up wrong. Here is what I am doing: sql = "UPDATE table1 SET Descript = @Desc " sql += "WHERE RefNum = @RefNum " cmd.CommandText = sql parm = New OdbcParameter("@desc", SqlDbType.Char, 120) parm.Value = oRow.Item("description").ToString().Trim() cmd.Parameters.Add(parm) parm = New OdbcParameter("@refnum", SqlDbType.Char, 12) parm.Value = oRow.Item("ref num").ToString().Trim() cmd.Parameters.Add(parm) cmd.ExecuteNonQuery() 'This fails with Syntax Error This is a shortened version, there are around 15 variables I am using. When I check the value of CommandText, it shows as: "UPDATE table1 sET Descript = @Desc WHERE RefNum = @RefNum" I am guessing this is what it should show, but is there anyway to see what is actually being sent to execute? Thanks

    Visual Basic question announcement csharp database

  • DataGridView Link Cell
    R rahvyn6

    Yes, the grid is bound at runtime, so although I know what the columns will be for the most part, they could change.

    C# database question

  • DataGridView Link Cell
    R rahvyn6

    There is a DataGridViewLinkColumn class, but dont know if that will help me once the grid has been populated already, as I'm unsure how to change the type of column.

    C# database question

  • DataGridView Link Cell
    R rahvyn6

    The only property I can see is the CellStyle property, I dont see a ColumnType property on the datagridview column.

    C# database question

  • DataGridView Link Cell
    R rahvyn6

    Windows.

    C# database question

  • DataGridView
    R rahvyn6

    I use this in the CellLeave event to update the underlying dataAdapter. Before calling this however, I loop through the grid to ensure that no values being updated are going to throw up errors. dataAdapter.Update(table);

    C# question database announcement

  • DataGridView Link Cell
    R rahvyn6

    Hi All; I'm working in VS2005, and have a DataGridView that draws from a datasource. Is there a way to change a column to be a link style column after the DataGridView populates? Here's how I populate it: DataSet ds = new DataSet(); dgvShipmentHistory.DataSource = null; SqlDataAdapter da = new SqlDataAdapter(mySQLClass.Query, mySQLClass.SqlCon); da.MissingSchemaAction = MissingSchemaAction.AddWithKey; da.Fill(ds, "ShipmentHistory"); dgvShipmentHistory.DataSource = ds.Tables[0]; dgvShipmentHistory.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); I want to be able to change one of the columns to be a link type column so that users can click the hyperlink and I can throw up a page. Thanks

    C# database question

  • serial port and data sequencing problem...?
    R rahvyn6

    Ok, try concatinating all values into one string, then sending that string to the port all at once. putc(value1 & ":" & value2 & ":" & value3 & ":" & value4 & ":" & value5 & ":" & value6); Not sure what language you are using to send the information, so may need a different concatenation value. Then, when you recieve the data, you will get the whole string at once, and the Split() command will split all the values so data[0] will hold value1, data[1] will hold value2 and so on.

    C# csharp question help

  • serial port and data sequencing problem...?
    R rahvyn6

    Im not sure what else to tell you without seeing the code as a whole. What I have posted should work. Com ports are pretty easy to work with, just make sure its opened correctly, then read the data and do what you need to do with it.

    C# csharp question help

  • serial port and data sequencing problem...?
    R rahvyn6

    You can take that out, its a class I wrote for logging errors.

    C# csharp question help

  • serial port and data sequencing problem...?
    R rahvyn6

    Hmm, how are you opening the port? I can run the line where you are getting the error. Here is how I open mine: try { if (comport.IsOpen) comport.Close(); else { // Set the port's settings comport.BaudRate = int.Parse(Settings.Default.BaudRate.ToString()); comport.DataBits = int.Parse(Settings.Default.DataBits.ToString()); comport.StopBits = (StopBits)Settings.Default.StopBits; comport.Parity = (Parity)Settings.Default.Parity; comport.PortName = Settings.Default.PortName.ToString(); // Open the port try { comport.Open(); } catch { } } } catch (Exception ex) { //no com port may be present log.Write("ERROR: " + ex.Message, "InitializePort"); }

    C# csharp question help

  • serial port and data sequencing problem...?
    R rahvyn6

    Do you get any errors when you open the port? Also, can you post the code within the data_recieved event handler?

    C# csharp question help

  • serial port and data sequencing problem...?
    R rahvyn6

    Yes, once you parse the recieved data, you can clear the array that holds it. Another option would be to close the port until you need it opened again. To clear the array, I think this should work: Array.Clear(data, 0, data.Length);

    C# csharp question help

  • serial port and data sequencing problem...?
    R rahvyn6

    What errors are you getting? Are you simply trying to set the .Text value of a textbox?

    C# csharp question help

  • serial port and data sequencing problem...?
    R rahvyn6

    Can you post the portion of the code you are having problems with?

    C# csharp question help

  • serial port and data sequencing problem...?
    R rahvyn6

    I'm not sure I understand what you are asking. You should be able to call a function from with the data_recieved() function. Like this: private void seriport_DataReceived(object sender, SerialDataReceivedEventArgs e) { // This method will be called when there is data waiting in the port's buffer string[] data; data = comport.ReadLine().Split(System.Convert.ToChar(":")); FunctionCall(); }

    C# csharp question help

  • serial port and data sequencing problem...?
    R rahvyn6

    Like this: value1:value2:value3:value4:value5:value6 You dont need one after value6, but you'll need one in between each of the other values.

    C# csharp question help

  • serial port and data sequencing problem...?
    R rahvyn6

    Can you insert a delimiter between the values using the printf? If so, then you can use ReadLine() on the serialport, and you would know that they are in the order you sent them. When you get the value, you can use .Split() on it, and put the values into a string array. Somthing like this: String[] data; data = seriport.ReadLine().Split(System.Convert.ToChar(":"));

    C# csharp question help

  • serial port and data sequencing problem...?
    R rahvyn6

    If you are not using a delmiting character, such as a comma or colon, then you would not be able to seperate the values. What does the string look like when it is sent to the port?

    C# csharp question 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