|
MAGICIANMERLIN wrote:
If one textbox is filled no problem i can do it but like if textbox1 and textbox5 was filled it must be example where textbox1.text=xxxxx AND textbox5.text=xxxxx....
Yes, that is right. You build the query dynamically, and AND is the SQL keyword you need, exactly as you put it.
Select * from Maindata where name='theName' AND address = 'myAddress' etc
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I need a VB prog that reads any incoming msg,,
gets sender email, subject, time_date of sending and body
of the msg..
thank u so much
A.Dhiab
|
|
|
|
|
|
thank u so much KaptinKrunch
but i still have some confusions about..
thanks again
A.Dhiab
|
|
|
|
|
I Work with VB.Net And use extarnal component to add in my project .The project in SetUp is Slow ,Some freinds said to me that C# is Quicker than VB.NET
The Quuestion:
IS this true ,if so ,What the Solution
|
|
|
|
|
If I'm not mistaken, C# and VB.net both compile to the same intermediate language (assembly). I read somewhere on MSDN that VB.net and C# executed at very close to the same speed.
If you want speed, you'll need a language that compiles to native code like visual C++.
|
|
|
|
|
Neither is quicker than the other. They both compile to the same Intermidiate Language.
Speed has two factors. The first (and largest contributor) is proper coding technique. The second is how close to machine code you want to write it in.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
The second is how close to machine code you want to write it in.
I disagree. One can write really slow code in assembly language just as easily as any language. the advantage a high level language brings is that the compiler can often generate fast machine code by optimizing even poor high level language code.
The speed of .Net apps comes from the runtime compiler which compiles the IL to machine code. Since it is runtime, it can take advantage of machine specific optimizations, and so sometimes generate code that is faster than the equivalent C or c++ code that was precompiled for a general target.
As a result, VB and C# are, for all pratical purposes, equivalent: both generate IL, which is compiled by the same runtime compiler at runtime, and so are almost certain to produce code that runs with the same efficiency.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
Rob Graham wrote:
I disagree. One can write really slow code in assembly language just as easily as any language. the advantage a high level language brings is that the compiler can often generate fast machine code by optimizing even poor high level language code.
Why do you think I put "proper coding technique" above all else?!?!?!?! Any idiot can write bad code in any language.
Rob Graham wrote:
The speed of .Net apps comes from the runtime compiler which compiles the IL to machine code. Since it is runtime, it can take advantage of machine specific optimizations, and so sometimes generate code that is faster than the equivalent C or c++ code that was precompiled for a general target.
The best optimizers on earth can't make up for bad coding technique in the first place.
Rob Graham wrote:
As a result, VB and C# are, for all pratical purposes, equivalent: both generate IL, which is compiled by the same runtime compiler at runtime, and so are almost certain to produce code that runs with the same efficiency.
Isn't that exactly what I said???
Why, again, do you disagree?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The only comment I disagreed with was the 'closer to the machine' comment (I should have made that clearer than just quoting it). IMO closer to the machine in no way gaurantees more speed. I have seen som real crap in assembly language, as well as some remarkably fast and brilliant code in high level languages. I heartily agree that good coding practice - and good design - is the most important factor in both speed and robustness, regardless of language.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
Actually, I was reading that VB.NET causes a lot more context switches, which means it can be slower in some instances. This was from a book on optimising ASP.NET applications in both languages.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I don't know about that. From what I've been reading, albeit only briefly, it can happen alot when you interlace blocks of code with HTML in ASP. I haven't found anything on that in ASP.NET, yet...
But in a Windows Forms app? VB.NET and C# would have to generate radically different code for something like that to happen. Wouldn't you think?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
VB.NET and C# would have to generate radically different code for something like that to happen. Wouldn't you think?
Yeah - this book is pretty deep, it covers every possible cause of unnecessary CPU usage, and it mentions that VB has some methods that cause it, as opposed to different methods C# has to do the same thing. I think it was to do with array lookups, but I can't recall. I didn't exactly do a dance and memorise the details
I can look it up if you like.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
I didn't exactly do a dance and memorise the details
Christian! I'm shocked! You didn't do a dance when you found something bad about VB.NET?!
What's the book? It woud be an interesting read.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
Christian! I'm shocked! You didn't do a dance when you found something bad about VB.NET?!
*grin* I recently found out that VB.NET supports optional parameters, which C# does not. I'd prefer operator overloading to optional parameters, but while I still personally hate to use VB, I was obviously wrong in thinking it is always behind C# in language features. So, I give up.
Dave Kreskowiak wrote:
What's the book? It woud be an interesting read.
Improving .NET application performance and scalability.[^] It's a great read, I've learned a lot about the framework I did not know, like WeakReferences, for example. One of the best things about becoming an MVP is that I got to choose a number of books, and I've been given more since, so I've got quite a number of the patterns and practices books now. Sadly, I'd just bought a whole lot, so some of my picks were areas of vague interest, I'd already bought the stuff I *really* wanted. But I'd say this is close to being the best of the lot, even better than Code Complete was.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hellow to all ..
can anybody tell me what's wrong with this insert statment
i recive Syntax error message ...
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Then
MessageBox.Show("Fill in all the fields")
Else
Dim ConnString As String
ConnString = "provider=microsoft.jet.oledb.4.0;data source=C:\Message.mdb"
Dim MyOledbCommand As OleDbCommand = New OleDbCommand
Dim OleDbConn As OleDbConnection = New OleDbConnection(ConnString)
OleDbConn.Open()
Dim String1, String2, String3, String4 As String
Dim u_date As String
String1 = TextBox1.Text
String2 = TextBox2.Text
String3 = TextBox3.Text
String4 = TextBox4.Text
String5 = Date.Today
Try
MyOledbCommand.CommandText = "Insert Into User " _
& "(user_name,password,first_name,last_name,u_date) " _
& "Values (" & "'" & String1 & "', " & "'" & String2 & "', " & "'" & String3 & "', " & "'" & String4 & "', " & "'" & String5 & "')"
MessageBox.Show(MyOledbCommand.CommandText)
MyOledbCommand.Connection = OleDbConn
MyOledbCommand.ExecuteNonQuery()
OleDbConn.Close()
MessageBox.Show("User was added")
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
Catch err As System.Exception
MessageBox.Show(err.Message)
End Try
End If
|
|
|
|
|
I used Matthew Hazlett bitblt code for vb.net and got it to work for part of what I wanted to do.
I have one picturebox which is my tileset holder. 32x32 tiles in size.
I have another picture box to hold the tile I clicked on(That part worked.)
Now I have a third picture box that is my map. I want to be able to click anywhere on picturebox3 and past the picture 32x32 in size from the second picturebox where I clicked.
The only thing I have got it to do is past it at 0,0 in the third picture box. I tired changeing numbers around and still nothing.
|
|
|
|
|
hellow to all
i wana add to my project a new form but i wana this form to be the first to load not the second one ...
how can i do it ?
thx to all ..
|
|
|
|
|
You have to change the startup object of your application:
Menu >> Project >> [ProjectName] Properties >> Startup object
|
|
|
|
|
|
ur welkum
|
|
|
|
|
Hi all, im a novice programmer. I was wondering how I could get a Folder Treeview with checkboxes (VB6). More specifically, I want to feed an array of directories (paths) to a treeview with checkboxes. These directories would be the highest level in the treeview (ie when collapsed, the only items or nodes would be the list from the array of directories).
The purpose of this is so that I can exclude or include (with checkboxes) subfolders for the purpose of copying files en-mass (a lot a time).
Ive seen examples of this from http://btmtz.mvps.org/treeview/ but as I am a novice programmer, I have difficulty in implementing... any help would be appreciated.
|
|
|
|
|
I need help i am trying to creat a program in VB.net for a pda.
i already have the database created using the quary analizer.
but i can not get the connection to work.
Public Sub conn()
Dim conn As New SqlCeConnection
conn.ConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; Data Source=\My Documents\abook.sdf;"
end sub
but i keep getting exceptions
i have searched threw several examples but they all start out by creating the database or using XML.
all i want is to retrieve data and manipulate it.
please some one explane what i am doing wrong, and a good example of what i need to do.
|
|
|
|
|
I have a scanned image which has two small circles in it. One is black colored another is white , in a picture box. I want to read the specific rgb of the two circles and represent the name black and white in two labels in a form.
Pls help me
|
|
|
|
|
Im a beginner in VB.net. Im was about to create a text log file to record my application activity such as the user update or delete something then such activity will be recorded in text file. I have this code from code project last time:
Private Shared Sub WriteToAppLog( _<br />
ByVal message As String _<br />
, ByVal messageType As EventLogEntryType _<br />
)<br />
Dim elLog As System.Diagnostics.EventLog<br />
Try<br />
elLog = New System.Diagnostics.EventLog( _<br />
"Application" _<br />
, Environment.MachineName _<br />
, Application.ProductName _<br />
)<br />
elLog.WriteEntry(message, messageType)<br />
Catch ex As Exception<br />
'Your error handling here<br />
End Try<br />
End Sub
But im not really understand how to implement it and where i can check the log file from above code? Does it appear to be .txt file? and does above code have to be placed in every form in my vb.net? If u have any other code than above, feel free to tell me.
Please help me, this is my last step of my project.
Thanks.
|
|
|
|