|
What abhi2008 said is correct principally.
But you shouldnt place too many controls onto one single form. Placing 1000 PictureBoxes onto one form will surely create some performance issues. What are you trying to achieve? Probably there is a better way to do it.
|
|
|
|
|
i've encountered some errors using parameters on my data adapter
i.e.
SELECT studno, studlastname, studfirstname, studmiddlename FROM students WHERE(studno = ?)
where the question mark will be the handler for the yet unknown student number that will be entered on runtime, thus will search for a specific row on the table
and the following error occurs
"the parameter ?_1 is unknown" or something like it i can't remember the exact words of the error message coz i'm away from my home computer.
needed immediate help thanks
|
|
|
|
|
Assuming you're using a database, you should use a stored procedure. If you're stuck with something that takes SQL and does not allow stored procedures, then shouldn't you do something like this:
string.Format("SELECT studno, studlastname, studfirstname, studmiddlename FROM students WHERE(studno = {0}", nStudNo)
to build your SQL ? Or have I missed something here ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i'm sorry i forgot to mention that i use access database so it's oledb provider i'm using, also i am configuring the parameters in the data adapter configuration wizard. will it work if i code it in the program.
|
|
|
|
|
Assuming that Access does not support stored procs ( I believe the latest version might ), then I'd simulate stored procedures by creating one class whose job it is to handle database code, so you still get that level of abstraction. Then if I *had* to generate SQL in my code, I'd do something like I suggested to build the query using a supplied parameter before passing the SQL string to Access.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thanks christian i'll try what you suggested
|
|
|
|
|
Christian Graus wrote:
string.Format("SELECT studno, studlastname, studfirstname, studmiddlename FROM students WHERE(studno = {0}", nStudNo)
Christian, I expected better of you! You might want to ready my article on SQL Injection Attacks and Tips on How to Prevent Them[^]
Access does support parameterised queries, if not Stored Procedures.
[EDIT]
Actually, given that nStudNo is most likely an integer type then it is unlikely to be a viable target for an injection attack - but getting into the habit not inserting values like this means just not having to second guess what is going to open up a security hole and what is not.
[/EDIT]
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Colin Angus Mackay wrote:
Actually, given that nStudNo is most likely an integer type then it is unlikely to be a viable target for an injection attack
Yeah, I was coming back to make that point You're right though, I should have pointed out that such an approach is open to injection attacks generally, even though mentally I noted it didn't matter in this case. Certainly, any string that gets passed into SQL in my code would first be cleansed to protect against such an attack.
Colin Angus Mackay wrote:
Access does support parameterised queries, if not Stored Procedures.
That must be what he was trying to call, I have no idea about access, I think it's crap.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
<id>4054
<r>255
<g>249
232
this is my XML file.so i need to add some data like
R=45
G=69
B=123
to this XML File through vb.net
how can i do this task.
suis
|
|
|
|
|
LOL - I take it the tags are <R> <G> and <B>, given that you didn't check 'Do not treat <'s as HTML tags' and so they were turned into HTML.
Why are you turning an image into a HTML file ?
The web abounds with examples on how to do this, you really should look for yourself before asking.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
<id>4054
<r>255
<g>249
232
this is my XML file.so i need to add some data like
R=45
G=69
B=123
to this XML File through vb.net
how can i do this task.
suis
|
|
|
|
|
I'm porting a VC++ (6.0) function i wrote into VB - VBA code in my MS Access database.
My question is how can i preserve the precision of variables in VB? (I'm not very familiar with VB and the differences in types between VB and VC++).
Example:
#define MY_PI (3.1415926535897932384626433832795)<br />
#define MY_2PI (MY_PI*2.0)<br />
#define MY_DEG_TO_RADS (MY_PI / 180.0)<br />
#define MY_RADS_TO_DEG (180.0 / MY_PI)
then when I do similiar in VB
'VB - VBA code<br />
Public Const VB_PI As Double = (3.1415926535897932384626433832795)<br />
... it get shortend automatically to
<br />
Public Const VB_PI As Double = (3.1415926535897)<br />
For now, I'm only concerned with converting between Degrees <-> Radians, but the difference in precision is still a concern.
Thanks,
Johnny
|
|
|
|
|
Use Decimal instead of Double
// TODO: Write code.
|
|
|
|
|
You didn't get that kind of precision in C++. The C++ Reference says that only 15 digits of signifigance are maintained around the decimal point, using a 1-bit sign, 11-bit exponent, and a 52-bit mantissa. So in effect, your statements are identical. VC6 just didn't go back and drop the numbers that weren't being used.
The Double type in VBA is the same as the Double type in C++.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks all for the info/help. I needed some verification on this from the experts.
Johnny
|
|
|
|
|
i m doing an ASP.NET Web Application...i would like to know how to use regular expressions for validating phone no, email id, date...etc..
please give an example
|
|
|
|
|
|
Hi,
I want to copy from .txt/.doc to clipboard .
How can i do this?.
Plz help me.
Thanks in advance,
Nisha
|
|
|
|
|
Hi,
Any thing has been avail in MSDN website. Goto there!!!
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconcuttingcopyingpasting.asp
bye by
Somasundar R
|
|
|
|
|
just anybody know that how to store a .GIF images to a ms access database ?
suis
|
|
|
|
|
You can serialise an image in any format ( jpg, raw, gif, etc ), and get it as a stream of bytes. You can get that stream from your DB and use it to rebuild the GIF.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I need help with the arrays and this is what i have done.
First i need to declare and initialize a procedure-level-one array named decRates that has five elements: 6.5,8.3,4,2,10.5.
Dim decRate() As Decimal= {6.5,8.3,4,2,10.5}
Dim decElement As Decimal
Now i need to display the arrays in the lblRate using For.. Next and also Do Loop
For Each decElement In decRate
Me.lblRate.Text= Me.lblRate.Text & decElement & ControlChars.NewLine
Next decElement
Can someone help me with the Do... Loop statement?
How do i also calculate the average of the numbers?
I hope that someone can help me!
|
|
|
|
|
Sounds like homework to me. At least you already started.
I think DoLoop is inadequate here. Nevertheless it could look like this:
Dim i As Integer
Do
Me.lblRate.Text = Me.lblRate.Text & decRate(i) & ControlChars.NewLine
i = i + 1
If i > decRate.Length - 1 Then
Exit Do
End If
Loop
To calculate the average just sum up all numbers and divide through the number of elements:
Dim sum As Decimal = 0
For Each decElement In decRate
sum = sum + decElement
Next decElement
Me.lblAverage.Text = sum / decRate.Length
|
|
|
|
|
Thanks for ur help Robert!
|
|
|
|
|
i m making an application in wich i need to send mail
can anyone plz help me
remember there is no namespace "system.web" and there is no class smtpmailmessage in vb.net
plz help
a code will be more helpful
|
|
|
|