|
Mohammed Amine wrote: yeah right , but how can he show filled fields without using dataset ??
There are many ways to show data without a data set. In general I rarely use them.
Mohammed Amine wrote: i think if he want to update on database he is obliged to use it
There is no obligation to use a dataset to update a database. The dataset is often a cumbersome representation of a database inside an application that can be more efficiently replaced. I only use datasets in throw away applications that I don't intent to maintain because they come with so many constraints.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
yeah you're right but i used to use that stuff because i often work on all the database that mean i get a lot of informations from all tables in ma DB so i need that representation on the memory
try to be good if you can't be the best
|
|
|
|
|
SwatiPathania wrote: Can anyone tell me the code (in vb.net) to delete one record from the database.
You don't mention what database. So, I'll assume SQL Server.
I've also assumed you have a String called connectionString which contains the connection string to your database. And, you have a variable called primaryKeyValue that matches the primaryKey of the row in the database that you want to delete.
Dim conn As SqlConnection = New SqlConnection(connectionString)
Dim cmd As SqlCommand = New SqlCommand
cmd.Connection = conn
cmd.CommandText = "DELETE FROM MyTable WHERE PrimaryKey = @primaryKey"
cmd.Parameters.Add("@primaryKey", primaryKeyValue)
cmd.ExecuteNonQuery()
Does this help?
DISCLAIMER: I'm not a VB.NET developer there may be some minor syntactic errors, but the logic is valid
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
I didn't know you can parameterize Deletes or other SQL commands. I thought it was only queries, because everyone always referred to it as "Parameterized Queries".
I learned something new today and am quite embarrassed I didn't find this out sooner.
Thanks for posting this Colin.
|
|
|
|
|
Joshua Quick wrote: I thought it was only queries, because everyone always referred to it as "Parameterized Queries".
I can see how that would be confusing if you only consider select queries as queries.
Everyting in SQL are queries, regardless if it's a select, update, delete, create table, drop table, etc. That's why the term "parameterized queries" includes any SQL command.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: Everything in SQL are queries
Yeah... that's what the 'Q' in SQL stands for.
I just never think of non-select statements that way. Afterall, I'm not asking for anything when I do an insert or a create.
Well, that's why I like to monitor these boards (and articles). Every once in a while I'll learn something new.
Now I must go punish myself by writing "All SQL commands are queries" 100 times.
|
|
|
|
|
you can use the Currency Manager
Private withEvents cm as CurrencyManager
cm.Deletefrom(cm.Position)
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
This error is displayed when trying to create a setup file including an executable and a .dll.
The keycode does not appear within the source code of the original program, nor is a property of the .dll being used.
Any ideas?
|
|
|
|
|
I've a datagrid.datasouce = ds1
i can delete and add and modify the datatable through the datagrid.
after that click on the save changes, until every thing working fine.
but when i do some changes on the datagrid like delete a record and click on save button a system.Data.DBConcurrencyException throw.
----------------------------------------------------------------
Exception
----------------------------------------------------------------
system.Data.DBConcurrencyException: Concurrency violation: the
DeleteCommand affected 0 records. at
system.data.common.dbdataadabter.update(datarow[],
datatableMapping tableMapping) .....etc
----------------------------------------------------------------
that's mean the user can modify one time...
so what is this execption.
and how can i solve it
thanx
Militiaware
Faris Madi
|
|
|
|
|
|
Hi All,
I am realy new to the socket issue..i need to trasfer file(s) (regardless the size) from one machine to another using Socket using vb.net!!
I searched the net and i found some that deals with small files and not asynchronously and in c# language.
I realy need your help...any comment will be very helpfull..
Thanks in advanced...
shelal
shelal
|
|
|
|
|
shelal wrote: I searched the net and i found some that deals with small files and not asynchronously and in c# language.
shelal wrote: I am realy new to the socket issue..i need to trasfer file(s) (regardless the size) from one machine to another using Socket using vb.net!!
http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx[^]
|
|
|
|
|
thanks Roath for your reply..it was a very usefull link...
|
|
|
|
|
You are welcome. My name is Kanel, please call me Kanel
|
|
|
|
|
Hello,
I have MS Access 2000 database file. One of the columns of a database table contains binary data. I know that this may be html or xml data, saved in this field. But I don't know the method it was saved to db.
Could anyone help me? I want to get these data back and have a look on it. How can I make it in VB.Net application (using oledbdataadpter)?
Thank you,
Loiste
|
|
|
|
|
This article[^] is present about saving image file to sql server. But you might found some method that might be similar to your need in ms access 2000.
|
|
|
|
|
Hii,
I need to set minimumpasswordlength for my system Using Visual Basic .
For this Iam Using IADsDomain interface.
My code is as follows....
Private Declare Function GetComputerName Lib "Kernel32.dll" Alias "GetComputerNameA" (ByVal strString As String, strSize As Long) As Long
Private Sub Command1_Click()
On Error GoTo ErrorHandler
Dim dom As IADsDomain
Dim cls As IADsClass
Dim v
Dim x As Variant
Dim str As String
Set dom = GetObject("WinNT://" & ComputerName & " ")
Set cls = GetObject(dom.Schema)
For Each x In cls.OptionalProperties
v = dom.Get(x)
Iam getting an exception in the above line
If x = "MinPasswordLength" Then
dom.MinPasswordLength = 10
End If
Next
ErrorHandler:
MsgBox Err.Description
End Sub
Function ComputerName() As String
Dim buffer As String * 512, length As Long
length = Len(buffer)
'GetComputerName returns zero on failure
If GetComputerName(buffer, length) Then
ComputerName = Left$(buffer, length)
End If
End Function
'My computer is connected in domain. if I specify the domain name instead of ComputerName in
Set dom = GetObject("WinNT://" & mydomain & " ")
,i could execute the code successfuly.But i need to execute the code on a system which is connected to work group (can be local system also)
Can anyone please provide me the relevant information??
Thanx
-- modified at 3:17 Monday 22nd May, 2006
|
|
|
|
|
I need to login to a remote system in a domain.
I have WMI as solution but problem with WMI is that unless a local profile does not exist it won't login.
Is there a way i can connect to a remote system without haaving profile on it.
|
|
|
|
|
nitin_ion wrote: I have WMI as solution but problem with WMI is that unless a local profile does not exist it won't login.
Is there a way i can connect to a remote system without haaving profile on it.
What do you mean by profile. In my opinion, you should have a correct user name and password. The profile of the user will create automatically when the user log on first time to the network. Is this answer offer to what you need?
|
|
|
|
|
No the problem is that i want to Login to a remote system using System.Management.ManagementScope.
I am able to login only if that user has local rights on that system. if i dont have it then it will say Access Denied.
Is there a way to login to a remote system with Valid User ID and Password without worrying about the fact that i will get Access Denied error.
-- modified at 5:59 Monday 22nd May, 2006
|
|
|
|
|
nitin_ion wrote: am able to login only if that user has local rights on that system. if i dont have it then it will say Access Denied
In my opinion, this problem cause by an operating system that it has it own local policies to manage login behavior. You should try to contact a network administrator to check whether the account that you log on is a right to log on locally or not.
nitin_ion wrote: Is there a way to login to a remote system with Valid User ID and Password without worrying about the fact that i will get Access Denied error.
In this case you must have your own user account with password protect. You can ask your network administrator to create an account for you.
|
|
|
|
|
I want a combo box which can be used to display a list of client names, but once selected, I want that particular client AccountNumber to be recorded in my MS Access MDB file in an InvoiceAccountNumber field.
How do I do it so that the combo always displays the full CompanyName, but always saves the InvoiceAccountNumber?
The reason for this is that the combo box gets its items from the same table that I'm writing back to so that if a client chooses to have their invoices sent to an alternative location, provided that the alternative location is recorded in my table, and that the entry has an AccountNumber, it is this AccountNumber which I want to record against my client InvoiceAccountNumber.
|
|
|
|
|
|
Hey guys i need to print the contents of a datagrid of the dataset the grid is reading from, i've been trying for a while any body have any ideas (codewise) to access a datagrid's info.
|
|
|
|
|