|
Thank you Dave...your privatepath gave me the right thing to lookup.
If you add this to your exe config, it will look in sub folders as well as the base directory for files that you are referencing.
In the example below, I want the exe to also prob sub folder controls.
<configuration>
<runtime>
<asemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="controls"/>
</assemblyBinding>
</runtime>
.
.
.
</configuration>
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
hi
I established a data base connection, where I used a query
sql_querry="SELECT name FROM sample_table"
is displaying all values perfectly, now I want to use where condition
sql_querry="SELECT name FROM sample_table WHERE"+"(Designation=SE)"<br />
But it is throwing an exception.
I think this one I am getting because I am not giving query perfectly.
Please tell me how to write this query.
Thanx in advance...........
sampath-padamatinti
|
|
|
|
|
sql_querry="SELECT name FROM sample_table WHERE Designation='SE'"
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
You should not use inline queries, they are dangerous and can lead to SQL Injection attacks.
Before you get a bad habit ingrained into your coding style learn how to use parameterised queries (or parameterized queries, spelling differs). There is a reasonable tutorial here[^] in PDF format, although it deals with Access it covers how to convert an inline query into a parameterised one, and the principles are the same. If you don't like that one then there are plenty more examples, just google for the phrase.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
sampath-padamatinti wrote: sql_querry="SELECT name FROM sample_table WHERE"+"(Designation=SE)"
On tpo of what everyone else said, if you look at the string you built closely, you'll see there is no space between "WHERE" and "(Designation=SE)". The resulting SQL looks like this (which is not a valid statement!):
SELECT name FROM sample_table WHERE(Designation=SE)
|
|
|
|
|
Dave, SQL Server parses and executes this statement. But if there was no '(' after the where clause, things would be different
|
|
|
|
|
Shameel wrote: Dave, SQL Server parses and executes this statement.
No kidding. I know that.
Shameel wrote: But if there was no '(' after the where clause, things would be different
Besides not having the "SE" in quotes, better yet, even as a SqlParameter, I like to see spaces where they are necessary and consistantly used, regardless of what the next character is.
|
|
|
|
|
Hi,
I am beginner to .net, I want to build a windows based application. That application needs back end access data base. So I want refer quickly DB connections and different commands possible to write in .net, Please refer me some links or any tutorial for this
Thanks in advance....
sampath-padamatinti
|
|
|
|
|
Search google with those keywords and you will find multiple tutorials and samples.
|
|
|
|
|
|
sampath-padamatinti wrote: Please refer me some links or any tutorial for this
Look at the Articles pages here on Code Project, there are hundreds to choose from, covering all subjects.
|
|
|
|
|
I am having trouble trying to preform a simple task in vb.NET
I am using a textbox to allow a user to enter in numbers and then click a button that will send the data to a rich text box to be displayed.
The trouble im trying to figure out is how can i count how many values the user enters in the rich text box?
So for example teh user enters: 5, 1, 3, 9, 19 clicks enter
then the rich txt box displays as so:
5
1
3
9
19
In a seperate label i will display the number of values entered: 5
How can I do this?
|
|
|
|
|
You can count the number of lines by counting how many newlines there are, or you could just split on whitespace and count it that way.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
respected sir,
i am working on datagridview in vb.net.
datagridview paging for not button use ( next , start ...) just 10 records at one time in datagridview and click (1,2,3.....) format so please send code in vb.net on paging datagridview..
thanks
|
|
|
|
|
Google broken where you live ? We tend not to answer people who ask us to do their work for them, without showing any sign of having tried to do it themselves.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Please don't pose such rude questions. Instead of asking code, why don't you google your problem or ask for help?
|
|
|
|
|
I need to convert data from hex to Dec and dec to Char
Kindly let me know how can i do that.
The confusion is if i need to change the data
If i provide Input as a string to the text box
3F 50 52 40 -> 63 80 82 64 -> ? P R @
|
|
|
|
|
You can use an overload of the ToString method to specify the number format to show.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Look up Byte Coversions in the MSDN index, you will see the following example;
Dim MyString As String = "Encoding String."
Dim AE As New ASCIIEncoding()
Dim ByteArray As Byte() = AE.GetBytes(MyString)
Dim x as Integer
For x = 0 To ByteArray.Length - 1
Console.Write("{0} ", ByteArray(x))
Next
That should get you started.
|
|
|
|
|
Hi,
your question isn't clear. Maybe what you want is: "I have a string with hex byte values, and I want to convert it to a string holding the ASCII-equivalent characters". If so, you need:
- a way to split the input string in substrings that each represent a single byte (e.g. use string.split to split on spaces)
- a loop to iterate over each substring
- byte.TryParse(...,NumberStyles.Hexadecimal) to convert this to a byte array
- Encoding.ASCII.GetString to convert to the result
- optionally insert spaces to separate the characters
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Hello,
I am working with VB.NET 2005.
1) I have class Chart that inherits from PictureBox
2) I have form that contains PictureBox1
The "connection" between them is as following:
PictureBox1.Image = Chart.GetBitmap
Now I have problems with events.
I would like to mousemove on the Picturebox and get some info and this info is is my Chart object
How to do?
I tried this but I got error message:"End of statement expected"
'Form1 (Main Form)
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles PictureBox1.MouseMove
RaiseEvent Chart.Chart_MouseMove()
End Sub
-----------------------------------------------
'Class Chart that inherits from PictureBox
Public Sub Chart_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
'Some infos
End Sub
Phease help
Shay Noy
|
|
|
|
|
[Modified following re reading your post]
The first thing to be aware of is your new class Chart can't raise events on the inherited (base class) picturebox
If all you are wanting is information returned etc. create a public function in the class chart and call it from inside the mousemove event or wherever on the main form.
If you do want to use events relating with your chart class, you will have to create these in your class and then when you declare the class in your form specify the withevents keyword. Then whatever code you are using in the class chart will have to fire these events.
Hope that makes sense!
Dave
modified on Sunday, October 25, 2009 2:53 PM
|
|
|
|
|
if I understood you right, see an example but it doesn't work:
Put Picturebox on your form6 (for example)
Public Class Form6
Private WithEvents ChartObj As New ChartClass
Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AddHandler PictureBox1.MouseMove, AddressOf ChartObj.ChartClass_MouseMove
AddHandler PictureBox1.MouseLeave, AddressOf ChartObj.ChartClass_MouseLeave
End Sub
End Class
Public Class ChartClass
Inherits PictureBox
Public Sub ChartClass_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs)
Cursor = Cursors.Default
End Sub
Public Sub ChartClass_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Cursor = Cursors.WaitCursor
End Sub
End Class
My question is why the cursor is not changing?
Shay Noy
|
|
|
|
|
I believe you'd need to click on the control for the move events to fire on that control. The enter event may work better ? Have you set breakpoints to see when the events are fired ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Clicking on the control for the move events doesn't fire too.
The enter event doens't work too
I set breakpoints and the events fired.
What is wrong?
Shay Noy
|
|
|
|