|
|
Hi, I am using VB.NET 2003/MS Access. I am getting data from a table into a particular datatable in a dataset. say the data fields are ID, Name, Period and Address. I want to obtain a record from the table for a particular period and ID. How can this be done using a select statement?
With Best Regards,
Mayur
|
|
|
|
|
SELECT * FROM TableName WHERE [ID]=@ID AND Period=@Period
!alien!
|
|
|
|
|
Thnx for your reply. Can you please provide some additional steps as to how I can get the values obtained by the select statement into different variables. I am a fresher in .Net.
how do you write the select statement for selecting records from datatable.
your select statement -
SELECT * FROM tablename WHERE [ID]=@ID AND Period=@Period
how do we replace tablename with dataset.tables(0)?
With Best Regards,
Mayur
-- modified at 0:46 Wednesday 15th February, 2006
|
|
|
|
|
This is example.
Private Sub FillDataGrid()
Dim strId As String = "" 'Set Id
Dim strPeriod As String = "" 'Set Period
Dim tableName As String = "" 'Set tableName
Dim connstring As String = "" 'Set ConnectionString
Dim selectSQL As String = "SELECT * FROM " + tableName + " WHERE [ID]='" + strId + "' AND Period='" + strPeriod + "'"
Dim conn As New OleDb.OleDbConnection(connstring)
Dim cmd As New OleDb.OleDbCommand(selectSQL, conn)
Dim ds As New DataSet
Dim da As New OleDb.OleDbDataAdapter(cmd)
Try
conn.Open()
da.Fill(ds)
DataGrid1.DataSource = ds.Tables(0)
Catch ex As Exception
MessageBox.Show(ex.Message, ex.Source)
Finally
If conn.State = ConnectionState.Open Then
conn.Close()
end if
conn.Dispose()
cmd.Dispose()
End Try
End Sub
!alien!
|
|
|
|
|
I believe Mayur was asking about how to select data from Data Table not from Database Table.
I was about to ask the same question.
My case is like this.
myDataTable = PopulateDataTableFromAnyTable()<br />
<br />
for each row in myDataTable <br />
<br />
Update DatabaseTable where FieldA = row.item(0) and FieldB = row.item(1)<br />
<br />
end for
If I directly update "DatabaseTable" for each iteration, it will be really slow.
So I was thinking to populate "DatabaseTable" to a Data Table, do the update in Data Table and then send the changes back to Database.
The problem is how to search data in data table with one or more criteria.
Thank you
WiL
|
|
|
|
|
Hey guys,
I have found the solution, I guess. Please refer to the link below.
http://www.c-sharpcorner.com/Code/2004/March/DataSetsIn.NETP2.asp[^]
Ofcourse, i have the same query as shiroamachi. how do you insert or update data into a datatable and finally update the database with the datatable. if anyone has any idea regarding this, plz let us know.
With Best Regards,
Mayur
-- modified at 4:07 Wednesday 15th February, 2006
|
|
|
|
|
Hi,
I want to use fax service extended com api with VB.NET and did the following:
I am using faxcomex.dll for fax server connection and etc.
Public Class frmSendFax
Inherits System.Windows.Forms.Form
Public WithEvents objFaxServer As New FAXCOMEXLib.FaxServer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
'Connect to the fax server
objFaxServer.Connect("")
objFaxServer.ListenToServerEvents(FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetINCOMING_CALL
+ FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetIN_QUEUE)
End Sub
Private Sub objFaxServer_OnIncomingJobAdded(ByVal objFaxServer As FAXCOMEXLib.IFaxServer,
ByVal jobid As String) Handles objFaxServer_OnIncomingJobAdded
Dim objFaxIncomingQueue As FAXCOMEXLib.FaxIncomingQueue
Dim objFaxIncomingJob As FAXCOMEXLib.FaxIncomingJob
Dim strCallerID As String
objFaxIncomingJob = objFaxIncomingQueue.GetJob(jobid)
strCallerID = objFaxIncomingJob.CallerId()
MsgBox(strCallerID)
End Sub
But how can I get the event called as it not happening in VB.NET???
I hope anybody can help me.
Thanks
Prasananjit Dash
|
|
|
|
|
At a glance, I can see one mistake:
objFaxServer.ListenToServerEvents( _
FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetINCOMING_CALL + _
FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetIN_QUEUE)
Should be:
objFaxServer.ListenToServerEvents( _
FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetINCOMING_CALL Or _
FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetIN_QUEUE)
Adding values together will cause bits to be set/reset where they shouldn't because of mathmatical carry's.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 10:46 Wednesday 15th February, 2006
|
|
|
|
|
Hi,
Is there a way to draw a picture on the titlebar
Please, help me
Thank you,
chatura
|
|
|
|
|
|
Thanks
chatura
|
|
|
|
|
Hello all!
Can anybody tell me how I can go about to synchronize the data between PXE servers using vb.net.
Thanks
|
|
|
|
|
PXE servers?
There's a ton of companies out there putting out their own implementations for PXE servers, so exactly what you'd have to do would be specific to the server your using. But I would imagine that you'd have to copy files between the file servers that are hosting the PXE server's data and images. There's no standard for storing this stuff so you'd have to do some homework on your servers to figure out what you would have to copy over and where to get at that data.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello Dave
Thanks for your reply! I am actually on internship and my company asked me to write a vb.net program to synchronize to a central server. I am totally clueless about it...with nobody to really guide me... Basically there are 3 servers, 1 running on server 2003 and the other 2 on NT4. Correct me if I am wrong. I have to upgrade the other 2 stations to server 2003 before I can test my synchro program? Can I use msmq to synchronise the server? How do I send and receive messages using msmq? Pardon me if my questions sounds dumb. Thanks!
|
|
|
|
|
The base server doesn't really matter, so long as all three servers are running the same PXE Server software. If not, you'll have to make that happen. If the PXE server software requires 2003 to run, then yes, you'll have to upgrade those base servers to 2003. Get it?
After that, it's just a matter of managing an inventory of files on all three servers and copying the last updated version to the other two.
Can you use MSMQ? I wouldn't recommend it. Do you really need to add that level of compexity to get this job done?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Need help on where to download a free full version Flex Cell 2.0 .net framework... pls help badly needed... links are highly appreciated......
:->
|
|
|
|
|
You asked this before. There answer is not going to change. And quit spamming a bunch of forums with the same question. It's very rude.
http://www.grid2000.com/[^] is the only place you're going to get this from and it's only the trial version that's free.
THERE IS NO FREE "FULL VERSION" AVAILABLE THAT IS LEGAL! If you want pirated versions of controls, you've come to the wrong place to ask where to get them.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Well, out of the 18 posts you have on CP, 1/3rd of them have asked this very question. And you specifically asked for the "full version", for which there is no free legal download. If all you wanted was the free trial version, a simple Google search for "Flex Cell 2.0" would have given you the answer in under 10 seconds.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I am having a problems in regards with date formats... pls help me, on how to display the day of the week as .....
example: if the date is "2/15/2006, Wednesday" ...
the word "Wednesday" will be the only one displayed in vb2005.net windows form..... tnx and more power
|
|
|
|
|
Try this...
Date.Now.DayOfWeek.ToString()
|
|
|
|
|
You can use
Now.DayOfWeek.ToString
'OR
Now.ToString("dddd")
!alien!
|
|
|
|
|
hello everybody:
i am new to VB.net I have to design a custom web server control which validates itself on client side and server-side. which means that i would not use a seperate custom validator for validation, but it should be a part of the custom control itself.and this validation would be done on clientside first, and incase javascript is off in browser then validation is done on server side.
The description of the custom control is as follows:
its a date control which has 3 dropdowns(dds).one for month, second for days and third for days.it has two properties isDOB(boolean) and getDate which returns the date in the format mm/dd/yyyy.
one method setDate which takes the string inn the format mm/dd/yyyy.This will set date according to the input string.
can somebody point me to the rite direction.any help would be deeply appreciated.
Thanks
Cheers!
AB
|
|
|
|
|
Hi, Im a pretty experienced VBA programmer trying to make the leap to VB.NET. Im working on my first real vb.net project and Im getting a little stuck. I have 2 tables, a Contact table and a Call table. Each record in the Contact table has multiple corresponding records in the Call table. I would like my form to display a Contact record and all the corresponding Call records. The way I would do this in VBA is I would have a main form with the contact info and then make a continuous subform with all the Call records that I would insert onto the main form. Then I would just link the primary key fields. Unfortunately there do not appear to be subforms in vb.net
I tried using a GridView control, but I was hoping to have labels and text boxes; not have it look like a spreadsheet.
I hope this all make sense.
Thank you.
|
|
|
|
|
Hi, I was wondering if you have had any luck with your continuos form? I have been searching for any help with this for the past few months and nothing out there seems work the same way the access continuous forms work. If you have any idea how to create a continuous form in vb.net could you send me a message back? thanks
eatwork
|
|
|
|