|
Wow your Code has nothing to do with ado.net, Paul told you to use a Correct Subect and secondy you are posting in a Wrong Forum. you should post this here
http://www.codeproject.com/script/Forums/View.aspx?fid=13695[^]
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I am new to vb.net and I am designing a custom control and I want to have one of the properties of that control have a dropdown list where the data in this list comes from a database and is not hard coded using a Public enum statement..
I know that you can create a dropdown list using a Public enum statement where the list is based on the the data typed in the enum statement as seen in my project below. What I can not figure out is how to create a dropdown list of values that would be loaded dynamically from a query from a database, or from an array
Is there a way to to fill a enum statement dynamically based of data from a query of a database? Or is there another method for filling a drop down list of a control property? Please show me the code in VB and not C#
Public Class UserControl1
Private myDirection As compas_dir
Public Enum compas_dir
North = 0
South = 1
East = 2
West = 3
End Enum
Public enumType As Type
Public returnValue As String
Public Property CurrentDirection() As compas_dir
Get
Return myDirection
End Get
Set(ByVal value As compas_dir)
myDirection = value
Label1.Text = [Enum].GetName(GetType(compas_dir), value)
End Set
End Property
End Class
|
|
|
|
|
I need to import excel records into access database using vb.net 2003.i’m successful in retrieving records from excel to datagrid.
The datagrid may have 1000 records with 10 columns.I need to iterate through each row of datagrid to find whether this record is
already exist in access database 2003.i have given 3 field combination as primary key in database.if record already exists in
Database it should ignore that row and check for next record of datagrid.and if tht record not found in database then it should able to insert that new record to access database.i need ur valuable suggestion regarding how to proceed
Or any sample codes wil help me a lot.
Please give me the solution as early as possible...
Thanking you in advance.
Regards
Chandru
|
|
|
|
|
You asked essentially the same question a month ago.
This isn't really a VB.NET question; it is more of a SQL question.
But, here is some help anyone.
Rather than checking to see if the record exists before inserting it, allow the insert to check if the record exists.
And, use a stored procedure instead of writing the SQL statments in the code.
Given these helps, you should be able to accomplish the task.
Tim
|
|
|
|
|
you said you have primary key table in the database.
So don't loop through each table rows with your records because it would take a lot of time
to loop through and execute the insert statement.
Better fire all the insert statements and catch the error message for primary key voilation and that's all. Your all the records that are not in the database will be saved and the other duplicate records will throw the exception saying it can't have duplicate primary key values.
enjoy
You can go to http://www.rprateek.blogspot.com[^] to get some more code for visual basic.
Interested in development projects
|
|
|
|
|
|
Am writing a search application and i require to spell check the words before being submitted to the search application. I am using MS word to accomplish this. it works ok but its too slow. Do you know a way out? I hoped .net has 'Did you mean' kind of a deal? does it?
Any thing am ready
|
|
|
|
|
Kanyungu wrote: I hoped .net has 'Did you mean' kind of a deal? does it?
Not that I am aware of. You might need to look at third party controls or implement one of your own.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Google use to have a SOAP API that you could use. I'm not sure if it's still available or not.
|
|
|
|
|
I have a spreadsheet showing a Purchase Order.
I wish to email it to the Supplier in a PDF format.
'Email The Order
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
"C:\DOCUME~1\David\LOCALS~1\Temp\" & strName & ".pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Application.Dialogs(xlDialogSendMail).Show
This seems to be the right way of doing it as far as I can tell.
HOWEVER...
It sends in .xlms format and can be opened at receivers end as spreadsheet!
If I send it manually as PDF no probs.
Where am I going wrong?
------------------------------------
"Password Protected? Your dealing with Geeks, just turn it on, type Gandalf and you're in!" - Frankie Boyle
|
|
|
|
|
I've never used this call before, but, I ran a quick check in VBA.
It looks like Excel is going to e-mail the spreadsheet in a spreadsheet format, not the file is was saved as.
Having said that.... my advice is: save the file as a PDF, then send the PDF using other VBA code.
A search of how to e-mail in VBA should reveal results, if not, let me know.
Tim
|
|
|
|
|
That works.
It is a bit of a kludge, save file as PDF, send the PDF, erase the PDF file!
(Not elegant either, but as it works I shall leave it working now. Thanks for that!)
------------------------------------
"Password Protected? Your dealing with Geeks, just turn it on, type Gandalf and you're in!" - Frankie Boyle
|
|
|
|
|
looking for an alternative and efficient way to transfer table records from one database to another database.
could it be done with one sql?
ty in advance
maytel
|
|
|
|
|
If the databases are in the same server, and the database user account has access to both, you can easily copy data from one database to another:
insert into database2..someTable (oneField, anotherField)
select oneField, anotherField
from database1..SomeTable
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
ty for the prompt help
but could i ask for code sample?
insert into C:\database2...
select *
from c:\database1...
ty
|
|
|
|
|
What type of database? It looks like you may be talking access here?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
sorry yup im using access
|
|
|
|
|
maytel mynt wrote: using access
So use File-->Get External Data-->Import
to import the tables you want.
--------------------------------------------------------
Knowledge is knowing that the tomato is a fruit.
Wisdom is not putting it in fruit salad!!
|
|
|
|
|
The subject has asked it all.. but additionally, just wanna know how to simply use that component in windows app. Secondly how to add that component to toobox.
|
|
|
|
|
|
IIRC the latest release of code on CodePlex[^] is in VB2008.
Anyway - if you add the compiled dll to the references of a windows forms project the component should show up in the toolbox. If it doesn't try a "Rebuild All"...?
|
|
|
|
|
Hi,
i have listbox control which contains mutliple items and on checkbox checking multiple items are selected , now how i insert those selected items in data base using single insert statement .
please give me hint i google many times but didnot find any hint ,
regards
Rameez
|
|
|
|
|
rameez Raja wrote: how i insert those selected items in data base using single insert statement .
Any particular reason why you can't just loop through the collection of multiple items and insert them one at a time?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Thanks for reply,
Actullay iam working on reservation application and listbox contains name of vehicles i want to store all slected vehicles .
you are right kindly write few lines of code how i do that .
loop throuh each items in listbox ? and store one by one
Regards
Rameez
Thnks in advance
|
|
|
|
|
If you are qualified to write the application then surely you can write code to loop through the selected items in a list box.
Bob
Ashfield Consultants Ltd
|
|
|
|