|
hey Jeffery,
i try this in my code but some problem in the updated stmt can u help me shoot wht the problem is the compiler thro me error The name Var1 does not exist in the class or namespace of the project....
here is the codesnippet
string strsql;
DataTable dt;
SqlDataAdapter da;
SqlConnection objConn = new SqlConnection("data source=yusuff;user id=sa;password=sa;initial catalog=Heritage");
dt = new DataTable();
strsql = "select * from Articles_production";
da = new SqlDataAdapter(strsql,objConn);
da.Fill(dt);
if(dt.Rows.Count > 0)
{
//foreach (DataRow dr in dt.Rows) //ervy loop
for (int i=0;i
|
|
|
|
|
Hi there,
i have a database which contain some junk character in some fields like for ex:"è" i need to replace this junk character into "è" the application where iam using this database is ASP page and need to have a solution where at one shot i can replace all this junk charac in my database fields there are around 7 different junk character in 5 fields and i have 500 records like this in my database
pls any solutions
regards
cyus
|
|
|
|
|
I am having problems with using an array to put info into a stack, I have to use parenthesis and put them in a stack and see if the string has equal parenthesis and i can come up with a code to just get the "(" out of a string
|
|
|
|
|
I don't understand the question. Perhaps if you post some code ? The replace method on a string can replace a ( with an empty string if that's what you need, or you could use regex if you wanted to.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
THIS IS THE PROBLEM:Use a stack to check whether a programming statement or a fuormula has a balanced parentheses. It checsk the number of parentheses in the expression and highlights a parenthesis that is unbalanced
|
|
|
|
|
Oh, I see. Have you written any code for your homework assignment yet ? If so, post it and I'll be glad to help. Otherwise, I won't do your homework for you.
Do you know what a stack is ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
For intI = 0 To StrExample.Length - 1
If (Char.IsPunctuation(StrExample.Chars(intI))) Then
stkReverseCheck.Push(StrExample.Chars(intI))
lstReverse.Items.Add(stkReverseCheck.Peek)
End If
Next
End Sub
I wanted it to check to see if it was an "(", "{" "[" and push it into the stack and when it came to a ")" "}" "]" put it into another stack and evaluate it the two stacks
|
|
|
|
|
There's no Char function for brackets, and because ( doesn't match } or ], you'd do better to build three stacks, one for each type of brackets. You could then pull them off for closing brackets from the right, and whatever is left on the stack, does not match anything to close it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i cant figure out how to work that with the string, when the array breaks it down what do i need to do for it to examine what it broke down to decide what stack to put it in
I tried if intI = ")", ect.... but it gave me a cant do it because Double error
|
|
|
|
|
You need to use single quotes to compare a char to a char, at least in C# you do.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
well single quotes in VB comment things out, and I cant see to figure it out
|
|
|
|
|
Something like this ? OR perhaps for each would work as nicely, and read better ?
Sub Main()
Dim s As String = "this (is )a ((test), sucka)"
Dim i As Int16
For i = 0 To s.Length
If s.Chars(i) = "(" Then
' push onto stack
End If
Next
End Sub
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
THanks, I am trying to figure it out
|
|
|
|
|
Glad to help. A lot of people post homework questions here, I have no time for them. However, people like you, who are trying to work it out for themselves and just need a little help, I'm always keen to help out.
Good luck.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Maybe you already figured it out, but a char in vb is something like
Dim c as Char = "("c
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
A good reference for parsing code (or whatever) is in Compilers, Principles techniques and Tools (aka The Dragon Book) by Aho, Sethi and Ullman, c. 198x?
...Steve
|
|
|
|
|
ahem..
Anybody knows how to use/connect an OpenDocument Database (OPEN-OFFICE DB), to VB.NET. ?
This is no emergency.
Thanks.!
Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU
|
|
|
|
|
Is there an ODBC driver for it ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Guerven wrote: This is no emergency.
Sorry I don't know the answer, but full marks for stating this in your post!
...Steve
|
|
|
|
|
i want to select one row from one datagrid which is binding to a dataset, then click add button to add this row into the datagrid below, how to implement this ??
emergency!! so everyone pls help me!!
I am Entry level person
|
|
|
|
|
maxiachun wrote: i want to select one row from one datagrid which is binding to a dataset, then click add button to add this row into the datagrid below, how to implement this ??
Seems fairly straight forward to me. What is the problem you are experiencing? Elaborate more and you may get a sensible answer.
maxiachun wrote: emergency!! so everyone pls help me!!
What sort of emergency? If this is for a uni project/homework etc, sorry but you've come to the wrong place.
...Steve
|
|
|
|
|
hehe! i need a bit help becoz i have problem in Currency manager binding! so i want someone to give me some advice!
I am Entry level person
|
|
|
|
|
here is some code!
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
If cnn.State = ConnectionState.Closed Then
cnn.Open()
da.Fill(ds.ProductTable)
dv = New DataView(ds.ProductTable)
cm = CType(Me.BindingContext(Me.ds, "ProductTable"), CurrencyManager)
If System.IO.File.Exists(sFile) Then
Me.Prizes1.ReadXml(sFile)
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
cnn.Close()
End Try
End Sub
Private Sub BtnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSearch.Click
Dim strFilter As String = "PLU_Number > 0"
If txtCode.Text.Length > 0 Then
strFilter = strFilter & "and Inventory_Code like '" & txtCode.Text & "%'"
End If
If txtPLU.Text.Length > 0 Then
strFilter = strFilter & "and PLU_Number like '" & txtPLU.Text & "%'"
End If
If txtDescription.Text.Length > 0 Then
strFilter = strFilter & "and Description like '" & txtDescription.Text & "%'"
End If
dv.RowFilter = strFilter
DataGrid1.DataSource = dv
End Sub
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim dr As Prizes.PrizeTableRow
Try
With CType(cm.Current.row, ds.ProductTableRow)
dr = Me.Prizes1.PrizeTable.NewRow()
dr.Inventory_Code = .Inventory_Code
dr.Qty = 1
dr.Awarded = 0
Me.Prizes1.PrizeTable.Rows.Add(dr)
End With
Catch ex As Exception
End Try
End Sub
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Me.Prizes1.WriteXml(sFile)
End Sub
End Class
I am Entry level person
|
|
|
|
|
maxiachun wrote: here is some code!
Ok I see the code but what is the problem?
On what line are you getting an exception or is it just not working as you expected?
I'm not going to analyze it for you. Make it easy for me and I'll help.
...Steve
|
|
|
|
|
maxiachun wrote: Dim strFilter As String = "PLU_Number > 0"
If txtCode.Text.Length > 0 Then
strFilter = strFilter & "and Inventory_Code like '" & txtCode.Text & "%'"
Here's an issue. You need a space after the 0, otherwise it looks like this:
PLU_Number > 0and Inventory_Code like etc.
Looking at the values in the debugger is a good way to find errors like this one, and always trailing a space if you must build SQL like this is another. Of course, you shouldn't build your SQL like this, for starters, if this is a real world app, you're wide open to injection attacks.
Christian Graus - Microsoft MVP - C++
|
|
|
|