|
|
Andy_L_J wrote: waveOutSetVolume(0, &H0000)
How is that different from waveOutSetVolume(0, 0) ?txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
I get confused with this stuff...never have to use these api's
dwVolume For the waveOutSetVloume function, this parameter specifies
the new volume setting. For the waveOutGetVolume
function, it specifies a far pointer to a location that will be
filled with the current volume setting.
The low-order word contains the left-channel volume setting,
and the high-order word contains the right-channel volume
setting.
A value of &HFFFF represents full volume, and a value of
&H0000 represents no volume.
If a device does not support both left and right volume
control, the low-order word of dwVolume specifies the volume
level, and the high-order word is ignored.
The example in the link explains.
To paraphrase, you must force the logical operation to use a four-byte Long Integer rather than a two-byte IntegerI don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Andy_L_J wrote: To paraphrase, you must force the logical operation to use a four-byte Long Integer rather than a two-byte Integer
Except that &H0000 is 16-bits, i.e. two bytes, not four.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Which one is the best for oracle server? System.Data.OleDb(.Net Faramework Data provider for ole db) or System.Data.OracleClient(.Net Faramework Data provider for Oralce)?
i'm using vb.net8
Public Shared DB_Connection As New OleDbConnection, DB_Command As New OleDbCommand
Or
Public Shared DB_Connection As New OracleConnection, DB_Command As New OracleCommand
I have creted a class ORACLE_SQL.vb for some basic oparation(DDL,DML) in oracle server. 3 pc are connected to a single database server. Both '.Net Faramework Data provider for ole db' and '.Net Faramework Data provider for Oralce' works replacing (swaping) the above Declarations and few more modification.
But i don't know which is the best. Can u plz tell me about the different between '.Net Faramework Data provider for ole db' and '.Net Faramework Data provider for Oralce'?
Thanks for reading my Q .
Here is some code of ORACLE_SQL.vb class:<br />
<br />
Public Sub New()<br />
If DB_Connection.State <> ConnectionState.Open Then<br />
Dim CONNECTION_STRING As String = ""<br />
'NewTec_Connection provides a default security for my app<br />
Dim NC As New NewTec_Connection<br />
CONNECTION_STRING = "Server=" & NC.ServerName & ";Uid=" & NC.UserName & ";Pwd=" & NC.Password<br />
Try<br />
DB_Connection = New OracleConnection(CONNECTION_STRING)<br />
DB_Connection.Open()<br />
'Create a transaction point<br />
BeginTransaction()<br />
Catch ex As Exception<br />
MsgBox("Can't use New() without having connection with 'NewTec' Server! Try New($) or New($,$,$) constructor.", MsgBoxStyle.Critical)<br />
Throw ex<br />
End Try<br />
'different types connections for oledb 'CONNECTION_STRING = "Provider=OraOLEDB.Oracle.1;Password=mypw;Persist Security Info=True;User ID=myname;Data Source=myserver" 'mdb'= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & FileName 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Desktop\DDLTEST.mdb;Persist Security Info=True;Jet OLEDB:Database Password=asd 'pw access="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Desktop\pwdb.mdb;Persist Security Info=True;Jet OLEDB:Database Password=***" 'ms sql=Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=iZMA\SQLEXPRESS 'CONNECTION_STRING = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=iZMA\SQLEXPRESS" 'DB_Connection = New OleDbConnection(CONNECTION_STRING) 'DB_Connection.Open()<br />
End If<br />
End Sub<br />
<br />
''' <summary><br />
''' Connect to oracle.<br />
''' </summary><br />
''' <param name="CONNECTION_STRING">set CONNECTION_STRING Like 'Server=giit;Uid=iZMA;Pwd=***' if using oracle provider. Otherwise for oledb 'CONNECTION_STRING = "Provider=OraOLEDB.Oracle.1;Password=mypw;Persist Security Info=True;User ID=myname;Data Source=myserver"</param><br />
''' <remarks></remarks><br />
<br />
Public Sub New(ByVal CONNECTION_STRING As String)<br />
If DB_Connection.State <> ConnectionState.Open Then<br />
DB_Connection = New OracleConnection(CONNECTION_STRING)<br />
DB_Connection.Open()<br />
BeginTransaction()' UF<br />
End If<br />
End Sub<br />
<br />
Sub New(ByVal ServerName As String, ByVal UserName As String, ByVal Password As String)<br />
Dim CONNECTION_STRING As String = "Server=" & ServerName & ";Uid=" & UserName & ";Pwd=" & Password<br />
If DB_Connection.State <> ConnectionState.Open Then<br />
DB_Connection = New OracleConnection(CONNECTION_STRING)<br />
DB_Connection.Open()<br />
BeginTransaction()<br />
End If<br />
End Sub<br />
<br />
'Execute<br />
''' <summary><br />
''' Not for select. For Insert, update, delete Statment.<br />
''' </summary><br />
''' <param name="SQL_Command"></param><br />
''' <returns></returns><br />
''' <remarks></remarks><br />
<br />
Function Execute(ByVal SQL_Command As String) As Integer<br />
Dim AffectedRow As Integer<br />
DB_Command.CommandText = SQL_Command<br />
AffectedRow = DB_Command.ExecuteNonQuery()<br />
RequireCommit = True<br />
Return AffectedRow<br />
End Function<br />
<br />
'''''''''''''''''*************************************
|
|
|
|
|
The Oracle provide is specifically written for interaction with Oracle databases (likewise the SqlClient is specifically from MS SQL Server databases) and therefore would provide better performance, but would limit your program to work purely with Oracle.
The OleDb is a more generic interface with would mean that you could use pritty much any SQL compatible database system such as Oracle, SQL Server MS Access, MySQL etc as your back-end database provided you limit your interact with the database to pure ISO SQL command.Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Thanks To: Steve Jowett
It’s a dedicated class for oracle server. So other databases (MySQL, MS SQL or MS Access) are not considered while build-up it.
I’m pleased for your advice but I can’t totally understand what u said bellow (about comment) of your Reply.
1st time I used ole db but that had a problem inserting date before 2000(‘1-jan-2000’ no error but before that date ’31-Dec-1999’ date generated an error) generated a strange error. So finally choose OracleProvider.
|
|
|
|
|
Based on what you said
kisukortechai wrote: It’s a dedicated class for oracle server
the Oracle provider is the right choice.Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
kisukortechai wrote: System.Data.OleDb(.Net Faramework Data provider for ole db)
That's a "general" database driver, and can be used to connect to SQL, Oracle or MS Access.
kisukortechai wrote: System.Data.OracleClient(.Net Faramework Data provider for Oralce)
That's the one that was created specific for Oracle, somewhat comparable to System.Data.SqlClient for SQL Server. This one is said to be faster and will have better support for Oracle-specific type and functions.I are Troll
|
|
|
|
|
Thanks To: Eddy Vluggen
I’m working only for Oracle server so in future I’ll need ole db if I change my mind. Am I okay?
|
|
|
|
|
You'd be largely okay;
- you'd be a bit more okay if you'd program against the interfaces. There's an CodeProject article here[^] that uses IDbConnection to make it easier to switch to another client.
- Other databases might speak a different SQL dialect. Oracle favors PL/SQL, SQL Server favors TSQL.
- There's also a small difference in formatting a parameter.
And you're welcome, off course I are Troll
|
|
|
|
|
I have a table InvoiceMaster table. And the table datas are available like the following manner
Invoice_No,Invoice_date,Customer_code,Qty,unit_rate,Item_Amount
10,12/02/2010,abc1,10,15.00,150.00
10,12/02/2010,abc2,11,10.00,110.00
11,12/02/2010,abc3,10,15.00,150.00
11,12/02/2010,abc2,11,10.00,110.00
11,12/02/2010,abc4,14,10.00,140.00
like wise...
Now the problem is , while using in multiuser [LAN] network, while saving time how to allocate the different Invoice number
for various user.
Thanks For The Ideas.. .
|
|
|
|
|
Classic problem.
My recommendation is not to "reserve" invoice numbers, but just create a transaction which will save the data and generate the invoice number at that time.
If you are using SQL Server, you can define a field to be an "Identity" column which will automatically generate the next available number for you.
The other way of handling this is to create a small table call it "Sequences" with columns, "Seq Name","Next Number" and you can use it to hold the next available invoice number.
Hope this helps.
|
|
|
|
|
Is there a way to determine from the datagridview.rows property whether or not the row is filtered by its controlling dataview? row.displayed and row.visible don't seem to do it.
Thanks
|
|
|
|
|
Are you saying that you are displaying rows from a bound source AND have added unbound rows to the DGV?
|
|
|
|
|
VB6Q I have 5 buttons. clicking them once changes that button's color to, say orange. And when another button is clicked that will become orange and the previous will reset to original color
So i want to toggle their color's depending on which one is clicked.
I want code to be efficient. No repeating codes.
Any ideas? Just tell me some ideas how to go about implementing it.
my idea:
send all button click events to a change color function. but we need to know which button has been clicked
Any other ideas welcom
|
|
|
|
|
ssonby wrote: send all button click events to a change color function. but we need to know which button has been clicked
Correct: you should just pass a reference to the clicked button.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ya how will i pass a refernce. its VB6. how do i come to know which button clicked it
|
|
|
|
|
Each button has it's own click event. In that event change the current button to orange and then set all the other buttons to the original color. Pretty simple actually.
EDIT:
Sorry, didn't see the part about no duplicate code. What you can do is create a control array out of the buttons then just reference the index of the button clicked. Also simple.-------------------------------------
Do not do what has already been done.
Absolute power corrupts absolutely.. but it ROCKS absolutely, too.
|
|
|
|
|
I knew that. But I dont want to keep it as array. as i can't give it my own name to each. it becomes a boring name. Is there a way to know who clicked it. like a 'caller' class or 'sender'. In .NET we have that 'e' variable which can references to the current button clicked
Thanks for your responses
|
|
|
|
|
About the only way to make it less generic is to create constant variables for each index so they're more descriptive. I'm not aware of any kind of 'sender' functionality. I guess you do what you can with the tools you're given. -------------------------------------
Do not do what has already been done.
Absolute power corrupts absolutely.. but it ROCKS absolutely, too.
|
|
|
|
|
and abandon doing this in VB6. It's hasn't been supported by MS in quite some time.
Move up to VB.NET at least.
|
|
|
|
|
Good day,
What is the difference between these methods of updating and which is better:
1. Add new row to datatable
Dim dr As DataRow = dt.NewRow
dr.Item("OrderStatus") = "OPEN"
dt.Rows.Add(dr)
'Update new row to database
Dim qry As String = "SELECT * FROM Table"
Conn.Open()
Dim da1 As New SqlClient.SqlDataAdapter
da1.SelectCommand = New SqlClient.SqlCommand(qry, MAIN.data.Conn)
Dim cb1 As SqlClient.SqlCommandBuilder = New System.Data.SqlClient.SqlCommandBuilder(da1)
da1.Update(MAIN.data.DS, "Table")
conn.close
2. Execute non query - does this work as stored procedure?
Dim strSQL As String = "INSERT INTO Table (OrderStatus)VALUES (@OrderStatus)
Dim cmdAddNew As New SqlClient.SqlCommand(strSQL, Conn)
cmdAddNew.Parameters.Add("@ScanStatus", SqlDbType.Varchar,50).Value = "OPEN"
Conn.Open()
cmdAddNew.ExecuteNonQuery()
Conn.Close()
|
|
|
|
|
I would say it all depends on the situaton. If you have a DataGrid bound to a DataTable, and your user adds a record through the DataGrid, then the first instance would probably be better. If in your data Layer you need a function to Save an object then I would use the second option. In the second option a stored procedure would definitely work. You need to set strSQl to the name of your Stored procedure, and then add
cmdAddNew.CommandType = CommandType.StoredProcedure .
|
|
|
|
|
Hi mates,
How can I join an access table with sql server table using vb.net. In access form, I can use the link table and by creating new query I can drag and drop the sql table and access table. How will I do that in vb.net. I tried dataset but the connection is only for access or sql server. Currently I have two database in my program. One is mdb and other is sql server. Please help me. Thanks in advance.C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|