I tell you what: you show me the code you wrote to do it, and explain what it does right, what it does wrong, how you tested it, and I'll help you fix it. But we aren't a code-to-order service: It doesn't quite work like that, we do not do your work for you. If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there. But be aware: you get what you pay for. Pay peanuts, get monkeys. The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." What is development? definition and meaning - BusinessDictionary.com[^] That's not the same thing as "have a quick google and give up if I can't find exactly the right code". So either pay someone to do it, or learn how to write it yourself. We aren't here to do it for you.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
:doh: May be try to verify database in report. Confirm the name of the text object. Then try again & let us know.
thatraja
**My Tip/Tricks
My Dad had a Heart Attack on this day so don't...
**
Hi, Without knowing exactly what criteria you want to use to split the string it is a bit difficult to give a definite answer. Something you could look at and that is really powerful is Regular Expressions (RegEx) Here are a few samples found using google: http://msdn.microsoft.com/en-us/library/8yttk7sy.aspx[^] http://www.codeproject.com/Answers/147947/How-to-split-string-to-two-text-boxes.aspx#answer2[^] Hope it helps. Valery.
Don't know. Didn't read it. Just responded to the post, not the btw. :laugh: OK. Just skimmed the article. Nope. Still, the OP just as likely did what I did, looked at the post itself which essentially said to redesign the database if it wasn't using datetimes.
And if you have to use such names, put them in square brackets []. Next, use a parameterized query, that will also handle the date/time problems.
INSERT INTO [trans] ([date],[heads],[debit],[credit],[descp]) Values(?,?,?,?,?)'
There are a few things that you need to look at here. 1. You are using a query (as others have pointed out) that is wide open to SQL Injection. 2. You don't dispose of your SqlCommand (try wrapping them it the using statement). 3. You are using the wrong method to read data (and I'm surprised nobody pointed this out to you). Basically you have opened up a DataReader to read a single value out of the database. This is overkill. Try replacing this with ExecuteScalar instead, which is designed to return single values. 4. In your finally block, you call conn.Close; what happens if you didn't manage to open the connection in the first place?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
Tom Deketelaere wrote:
I don't know why but I'm in a picky mood today
The example shows that picky is what's being trained - since the devil is always in the details :)
I are Troll :suss:
Go and visit the VB Forum, strange that there is someone asking the same question over there! You two individuals on the same course / doing the same homework / working on the same thing?
Dave Don't forget to rate messages!
Find Me On: Web|Facebook|Twitter|LinkedIn
Waving? dave.m.auld[at]googlewave.com
try
select top 1 productid, u_price, qc_dt
from (select productid, u_price, qc_dt
from qc
where productid = 1011
order by qc_dt desc) z
Marc Clifton wrote:
That has nothing to do with VB. - Oh crap. I just defended VB!
how to use brain cells? how to read book? how to ask questions? :~
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Prolific encyclopedia fixture proof-reader browser patron addict?
We all depend on the beast below.
Sure. Just pickup a library that supports converting between the two formats. Google for "c# video conversion library[^]".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...
The values you try to add to your ugly dynamic SQL are of type DataGridViewCell So first of all, use dataGridView1.CurrentRow.Cells[x].Value to extract the values and as OriginalGriff already said, use parameterized queries. It's easier, more readable, more efficient and NOT UGLY.
var question = (_2b || !(_2b));