|
U_subhu4u wrote: consouil
Did you mean console ?
chatura
|
|
|
|
|
ya
i mean what is console Programming
can u give me an example of thif programming
subhash kumar (delhi india)
|
|
|
|
|
ya
i mean what is console Programming
can u give me an example of thif programming
|
|
|
|
|
|
U_subhu4u wrote: what is consouil programming
Try Google[^]
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
i am using two FORMs. Form1 and Form2
Form1 have dialogbox, menu button etc and Form2 contain Richtextbox1..
from Form1 menu i open opendialog box i want the file open and display it in form2 richtextbox.
please help me and reply me soon....
zabsmarty
|
|
|
|
|
you can use this in both VB.Net 2003 & 2005
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then<br />
Dim newForm2 as New Form2<br />
newForm2.RichTextBox1.LoadFile(OpenFileDialog1.FileName)<br />
newForm2.Show()<br />
End If
chatura
|
|
|
|
|
Hi,
I’m new to ADO.Net and I’m using VB.Net 2005. I have created a form which
has a Data Grid, a ‘Show Data’ button and a ‘Update’ button.
Also I have created a BindingSource, a TableAdapter and a DataSet. BindingSource is connected to an Access Database.
I can get data by using
Me.myTableTableAdapter.Fill(Me.DBDataSet.myTable)
But when I tried to update the TabelAdapter
Me.myTableTableAdapter.Update(Me.DBDataSet.myTable)
I received an error
“Update requires a valid UpdateCommand when passed DataRow collection with modified rows.”
Then I double clicked the ‘DBDataSet.xsd’ on the Solution Explorer window and I selected myTableTableAdapter and created a new UpdateCommand
Now I receive an error
“Command text was not set for the command object.”
I do not know what I have to do next
Please Help me
Thank you
chatura
|
|
|
|
|
First create a command builder and then update the Data Adapter.
Dim CB As New OLEDBCommandBuilder(myTableTableAdapter)
Me.myTableTableAdapter.Update(Me.DBDataSet.myTable)
With Best Regards,
Mayur
|
|
|
|
|
When I try to do that I get a compilation error
WindowsApplication2.DBDataSetTableAdapters.myTableTableAdapter' cannot be converted to 'System.Data.OleDb.OleDbDataAdapter'.
WindowsApplication2 is my project name
chatura
-- modified at 0:46 Friday 10th March, 2006
|
|
|
|
|
Yes… I found the answer I haven’t created the Primary Key.
chatura
|
|
|
|
|
Hi All,
I am working on the datagridview control. It has datagridviewcomboboxcolumns and I try to add the "selectedIndexchanged" event to the code by writing the foll. line in the gridview's EditingControlShowing event.
Dim comboBox1 As ComboBox = CType(e.Control, ComboBox)
This works ok when I click on combobox column of the grid but gives me an error if I click on any other column. Can anyone please let me know how I can check for this??
Thanks a lot!!
|
|
|
|
|
What does the @ do in the following statement?
Is this used to pick the particular DB field associated
with the row in the update statement?
Dim strSQL As String = _
"UPDATE [Products] SET [ProductName] = @ProdName, " & _
"[UnitPrice] = @UnitPrice, [ProductDescription] = @ProdDesc, [LastUpdated] = @LastUpdated " & _
"WHERE [ProductID] = @ProductID"
|
|
|
|
|
That's SQL stored procedure syntax. The items with '@' in front refer to parameters being supplied to a stored procedure. The only reason you should ever see this in VB code is if the code is attempting to create the stored procedure on the SQL Server - I can't see that this would ever work if you attempt to run it as an update statement directly from a VB app.
It's possible that someone's copied and pasted the code from a stored procedure directly into VB as an attempt to do an update, but I don't believe it can possibly work.
|
|
|
|
|
Craster wrote: The items with '@' in front refer to parameters being supplied to a stored procedure.
Among other things. See also Guffa's reply to the Original Poster.
Craster wrote: The only reason you should ever see this in VB code is if the code is attempting to create the stored procedure on the SQL Server - I can't see that this would ever work if you attempt to run it as an update statement directly from a VB app.
This is incorrect.
Craster wrote: It's possible that someone's copied and pasted the code from a stored procedure directly into VB as an attempt to do an update, but I don't believe it can possibly work.
Yes, it can work. You pass parameters for any SQL Statement through the SqlCommand object. For example. The SQL:
SELECT * FROM MyTable WHERE name=@name Can be accessed in VB as:
Dim cmd As SqlCommand
cmd = New SqlCommand()
cmd.CommandText="SELECT * FROM MyTable WHERE name=@name"
cmd.Parameters.Add("@name", "John Smith")
cmd.Connection = MyConnection
Dim reader As SqlDataReader
reader = cmd.ExecuteReader()
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
No, they are parameter names. When excuting the query, you also have to add parameter objects to the command object for each parameter in the query.
Example:
command.Parameters.Add("@ProductID", SqlDbType.Int).Value = 42;
---
b { font-weight: normal; }
|
|
|
|
|
:(i am using toolbar component .net ver 2 (not toolstrip) in vb.net 2005.
if i give application.enablevisualstyle command to enable xp style interface
then icons on my toolbar will not come. if i disabel xp visual style it will
come? how can i show this toolbar in xp style settings?
pls help me....
ajo
|
|
|
|
|
This is a bug in the .NET framework. You can work-around it by calling Application.DoEvents() after EnableVisualStyles.
|
|
|
|
|
Hi all,
Can anyone tell me if database triggers are possible with msde 2000? I want to have a trigger in my vb.net(2003) application whenever someone inserts a row in a particular table i get a trigger. Working example would be more than welcome or direct me to some articles.
thanx in advance
Qaiser
|
|
|
|
|
This is a quote from MSDN[^] which I found using this Google search: msde 2000 trigger .
When to Choose MSDE<br />
<br />
MSDE is an attractive option for upgrading existing Jet applications to improve scalability or for creating new desktop and shared database solutions that can be easily migrated to full SQL Server, as the solutions must need to scale.<br />
<br />
SQL Server compatibility<br />
<br />
MSDE data engines are fully compatible with SQL Server. Thus, tables, stored procedures, triggers, and any other database objects created in MSDE will operate without modification in a SQL Server database. In contrast many Jet objects, such as queries, cannot be migrated to SQL Server without modification. If you are considering migrating to SQL Server in the future, or it is likely that your database application will exceed the limitations of Jet, you should choose MSDE. Doing so will provide you with the simplest path to upsizing the database to SQL Server without changing a single line of code.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
Hi,
Creating a trigger using the Server Explorer window.
Write the following code in the trigger text editor.
CREATE TRIGGER SampleTrigger
ON dbo.Fresh
INSTEAD OF INSERT
AS
DECLARE @id varchar (10)
SELECT @id=id FROM Inserted
IF (NOT EXISTS (SELECT Fresh.id FROM Fresh WHERE Fresh.id=@id))
INSERT INTO Fresh
SELECT id,sname FROM inserted
ELSE
PRINT 'can not add to the database'
A trigger is a procedure that SQL server invokes automatically when certain changes applied to the data. We can think of triggers as VB>Net event handlers for onUpdate,onInsert, and onDelete events.
More:Refer this title: "Database programming using vb.net and sql server 2000"
http://www.vkinfotek.com
Regards
Bhar
|
|
|
|
|
Hi Krisky,
Thanx for your reply but i already know this bit creating a trigger in database. Thing i want to know is how to get this event in you vb.net application? Say i created a trigger in a table called sales and when ever someone insert a row in it i get an event in my application. I know this makes database slow, it's not a recommended way etc etc but every thing is on a local system, there are few applications running on a system and eachone updates/insert records in the database, so i want in my application whenever some other application enters data in a specific table in database(i know other ways of interprocess communication in .net but those other apps are third party on which i have no control) i get an event in my vb.net/c# application.
Qaiser.
|
|
|
|
|
You won't get an event fired in your VB.NET app. It just does not work that way for the reasons you have already stated plus more - including the fact that SQL Server and your app are in different processes.
What you could do is run a CMD, BAT or EXE from your trigger code which itself calls your app to do whatever, but even that gets tricky and prone to performance issues.
You could just monitor the SQL transaction log (no forget that - you'll probably need 3rd party software to do it or else delve very deep into SQL Server innards).
How about writing a row to a separate table whenever your trigger fires? Your app can then monitor that table for new entries every 30 seconds or so and act accordingly.
I think there are some very basic examples of how to do soem of these things in the SQL Books Online - installed when you install SQL Server client and/or dev tools on your machine.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
Steve,
Thanx for your reply, your suggestion is good but it is not applicable in my situation, why? because i need the trigger/event in my app as soon as database entry is entered so can't wait for 30 seconds etc.
Anyway thanx for you guys to help.
Qaiser.
|
|
|
|
|
What's so important about trapping the event during the trigger execution?
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|