|
i have used check constarin like this
constraint disignation CHECK(Designation IN('Key Person','Assignee')),
when i try to enter data using my code
it,s getting error on this constrain.
in the code i have used combo box and there fixed items.i access this item using "bombobox1.selecteditem"
but i check it using msgbox and it,s giving correct word.i,m confused with this coz i have used this on vb.net 2003
now i,m using vs2005
can any one help me
my quary string is like this
"insert into Complaint values('" & cbocustomerId.SelectedItem() & "','" & cborepID.SelectedItem() & "','" & cbosource.SelectedItem() & "','" & rtxtdescription.Text & "','" & cboempID.SelectedItem() & "','" & txtdate.Text & "','" & cbocatagory.SelectedItem() & "','" & cboFtype.SelectedItem() & "' ,'" & txtvehicleNo.Text & "','" & txtbustop.Text & "','" & cboOp_dept_no.SelectedItem() & "','" & cbostatus.SelectedItem() & "','" & txtrefNo.Text & "','" & txtplace.Text & "')")
-- modified at 7:39 Monday 22nd May, 2006
|
|
|
|
|
I have make a application that the user will open a whole day,
The application contains a folder watcher, when new file created in that folder,
A event will rise.
How can I set my application at the top of screen?
I have tried me.show, me.activate, me.WindowState = FormWindowState.Maximized ...
All these cannot work properly.
|
|
|
|
|
Hi,
If you are trying to make the window as top-most accessible window you should try to load it with .ShowDialog instead of show.
batmike2000
|
|
|
|
|
Hi ,
Can anyone tell me the code (in vb.net) to delete one record from the database. I m totaly confused about it. Plz tell.
Thanks.
Swati Pathania.
|
|
|
|
|
Hi,
Do you want sql query for that.
Best Regards,
Apurva Kaushal
|
|
|
|
|
no sql query
you have to use the dataset & the table in the dataset you have that record in
& you have two ways
if you are working with rownb
well i can't explain now but it is pretty easy give me just how you fill fields from database i meant the methode or the way you follow to reward your records & i will write you how to delete it with all the necessary explanation , are you happy ?? don't be confused nobody was born knowing everything
try to be good if you can't be the best
|
|
|
|
|
Mohammed Amine wrote: no sql query
you have to use the dataset & the table in the dataset you have that record in
If you are using a dataset, what do you think the .NET Framework sends to the database? A SQL Query. So there is a SQL Query.
The OP also did not say anything about using DataSets so this solution may not be advisable in his situation.
"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 right , but how can he show filled fields without using dataset ??
i think if he want to update on database he is obliged to use it
so i asked him for the way he use to forward or to show his records in the fields that is all
sorry i didn't want to mean no sql query just i wanted to make it easy for him
try to be good if you can't be the best
|
|
|
|
|
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
|
|
|
|