|
Been through that book, it doesn't go through SQL database programming. Select and Insert Command.. We are getting somewhere eventually.. Beasically, I am not asking anyone to write the whole code down for me. as Mentioned on the starting thread, I gave a small example of what I am trying to do and hopefully, someone out there who is helpful enough and have some spare time in his hands can help out.. This is what this thread is for, after all..
So anyone else with some knowledge on this and is willing to help... Will appreciate your time...
|
|
|
|
|
hi all
in my project i have table emp.i want to put all my data accessing function add,delete,update in my class.in my form a will use this class object to accessing function.how i can do this.
|
|
|
|
|
use this function for retrival
Public Function FetchData(ByVal tableName As String, Optional ByVal sql As String = "", Optional ByVal Transaction As OleDb.OleDbTransaction = Nothing, Optional ByVal mAddWithKey As Boolean = True) As DataTable
Dim tblData As DataTable
If sql = "" Then
DADPTable = New OleDb.OleDbDataAdapter("Select * from " & tableName, DataConnection)
Else
DADPTable = New OleDb.OleDbDataAdapter(sql, DataConnection)
End If
If Not Transaction Is Nothing Then
DADPTable.SelectCommand.Transaction = Transaction
End If
DADPTable.AcceptChangesDuringFill = True
If mAddWithKey Then DADPTable.MissingSchemaAction = MissingSchemaAction.AddWithKey
tblData = New DataTable(tableName)
DADPTable.Fill(tblData)
FetchData = tblData
tblData = Nothing
End Function
Use this function for update :
Public Sub UpdateData(ByVal tableName As DataTable, Optional ByVal Transaction As OleDb.OleDbTransaction = Nothing)
Dim commandBuild As OleDb.OleDbCommandBuilder
DADPTable = New OleDb.OleDbDataAdapter("Select Top 1 * from " & tableName, DataConnection)
If Not Transaction Is Nothing Then DADPTable.SelectCommand.Transaction = Transaction
Dim tblAdd As DataTable = ds.Tables(tableName).GetChanges(DataRowState.Added)
Dim tblModify As DataTable = ds.Tables(tableName).GetChanges(DataRowState.Modified)
Dim tblDelete As DataTable = ds.Tables(tableName).GetChanges(DataRowState.Deleted)
If Not tblAdd Is Nothing Then
If tblAdd.Rows.Count > 0 Then
commandBuild = New OleDb.OleDbCommandBuilder(DADPTable)
DADPTable.InsertCommand = commandBuild.GetInsertCommand()
If Not Transaction Is Nothing Then DADPTable.InsertCommand.Transaction = Transaction
DADPTable.Update(tblAdd)
End If
End If
If Not tblModify Is Nothing Then
If tblModify.Rows.Count > 0 Then
commandBuild = New OleDb.OleDbCommandBuilder(DADPTable)
DADPTable.UpdateCommand = commandBuild.GetUpdateCommand()
If Not Transaction Is Nothing Then DADPTable.UpdateCommand.Transaction = Transaction
DADPTable.Update(tblModify)
End If
End If
If Not tblDelete Is Nothing Then
If tblDelete.Rows.Count > 0 Then
commandBuild = New OleDb.OleDbCommandBuilder(DADPTable)
DADPTable.DeleteCommand = commandBuild.GetDeleteCommand()
If Not Transaction Is Nothing Then DADPTable.DeleteCommand.Transaction = Transaction
DADPTable.Update(tblDelete)
End If
End If
DADPTable = Nothing
commandBuild = Nothing
End Sub
V.Gopi.
Easy Design Systems
Coimbatore
India
|
|
|
|
|
Hi,
Can someone please brief me on how to save 'pdf' files(there are about 15 files) into a SQL database and retrieve/open it from a datagrid?
I have about 15 pdf files on my webserver and need to save it in the SQL database, so every pdf file saved in the database will have a primary key and the file will be saved either as 'ntext' or 'binary' type...I just have this rough idea.
If someone has a ready code in VB.net then nothing better( i know thats a shortcut but it will help me like a tutorial. C# code will do too, I can then convert the code to Vb.net
Thanks a ton.
Aartee.
...HE is watching Us All!
|
|
|
|
|
Does anyone know how to write help files for a VB program I wrote?
I need to add help files to the program, but I've got no idea how to do this.
Thanks alot
|
|
|
|
|
I don't know if there are new way of doing it but I use the HTMLHelp Workshop (easy to search and DL for free from MS). You write html pages and then you compile them into a .chm help file.
|
|
|
|
|
Hi Friends,
I came to know that there r skins availale for .NET. I mean if we attach that skin to out .NET intsallation then then whatever UserID we design will automatically be as per that skin rather than the default style. We can then change that appereance but at the first time when we add new control or form in our application it will appear as per the theme that we have attached with the .net installation.
So any one can tell me from where I can get these themes and how can I attach that to my .NET?
Plz send me reply soon.
Thank u all.
|
|
|
|
|
Hi all,
I am new to .Net. I have created a windows application in vb.net.
Now the problem is that
I want my application to be a piracy free so that
1)no one can copy from CD to any other medium and
2)no one can setup my application more than once from the CD.
Is there any possibility.If yes please tell me
Thanks in advance
|
|
|
|
|
Anonymous wrote:
1)no one can copy from CD to any other medium and
There is no language on earth that can do this for you.
Anonymous wrote:
2)no one can setup my application more than once from the CD.
Again, there is no language on earth that can do this for you. This can't be done at all.
Anonymous wrote:
I want my application to be a piracy free so that
This is the pipe-dream of copy protection. You will NEVER be able to make anything "piracy free". If that was possible, we'd all be paying $5 for video games and $20 for MS Windows, MS Office, ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi,
i want to shutdown another pc in my LAN kindly help me.
bye
basanta
|
|
|
|
|
Step 1: Go to the PC
Step 2: Pull the plug out of the wall socket; or switch it off.
Yes it can be done programatically, but I don't intend to outline the procedure in this forum.
Apart from the hacking reasons I can think of, why would you want to do this?
...Steve
|
|
|
|
|
pls send the code how run the .avi,.dat file in using asp
ok after this year 2004
|
|
|
|
|
You've gotta be joking !?
...Steve
|
|
|
|
|
Hi all..
I am a very new person in developing this web application using vb.net. Just wondering something, hope someone out there could reply to my question. Well.. in the aspx form, the html code, sometimes i'd see vb coding in <%.. %> tags.. when do the codes in the coding be trigger? how do you use it?
Thanks..
a very confused new starter
|
|
|
|
|
Thoese characters are the asp code delimiters, meaning they were/are used in "ordinary" asp development to tell what is script-code and thus needs to be handled by the server before the document is created and sent to the browser.
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
Somebody knows some function to generate the numbers of the bar codes EAN13? With 12 characters of data and the 13th digit as check digit. How the code EAN13 is generated?
|
|
|
|
|
What's wrong with typing "VB.NET EAN13" into Google?
Here, let me do it for you...clicky[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I want to interact with OS (Windows)'s buffer, exp: write, read or manager OS's buffer. What is code in VB.Net or C# to do it.
Thanks.
|
|
|
|
|
Huh? This does not make sense. Which buffer are you talking about?
...Steve
|
|
|
|
|
LOTS more explaination is needed here! What buffer? Which API are you using? If this buffer part of your app or another app? What are you trying to do with this buffer?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am working on a tool for Data Services, and decided to create the tool as a VB.NET windows application. I am not a VB .Net developer, but know enought to get by, though I struggle with the controls because I've never used them (I have used VB 6 controls).
The purpose of the App is to Update an online questionnaire, the questionnaire has branching...etc.
So far, I open a form that Loads two drop down boxes. 1st drop down loads companies, second drop drown is bound to questionnaires for the company selected. You then select the questionnaire being updated.
Then I use Common Dialog, open file, to select an Excel spread sheet that has the new questionnaire stucture, with new questions.
You then click on "Update" and the excel spreadsheet is loaded into a datatable, and the existing "Active" questionnaire is pulled from the DB into another datatable. I then do a row by row comparison against the spreadsheet and the existing version comparing things like question text, answer label, incorrectness of question....among other things, in order to determine if there are new questions being submitted, other wise, I want to use the existing question. some of these take human interaction in order to determine if the question is new. Although I scrub the excel data down, there are still things you cant possible take into account.
So after doing all my comparisons, in instead of popping up a message box every time somethiing is different (there are hunderds of rows and this woudl be annoying) I would like to mark (flag) differences and then when comparison is complete, open up a new form with a with a check box by each possible new question, so the user can validate, by going through and checking what IS actually new.
What control should I use? A listview? I want a checkbox on the left. I would also like to change the background color of the part that has actually changed. Say for instance, the question text changed, or the Answer text changed, of if the incorrectness changed, then mark that.
Thanks in advance for time in effort in this matter. Also, any good resources on the recommended control would be gread.
Shawn
|
|
|
|
|
I don't think you really have any options that will support everything you describe.
There is a CheckedListBox, but no control over the colors.
You might could write enough code to make the intrinsic NET DataGrid control do what you want to do, but it would take a lot of work.
What you really need for this sounds like probably a 3rd party grid, like ComponentOne (the old Apex True Grids) - they generally give you a lot more control than you have over Microsoft controls.
This would have been a lot easier to do in VB6 because you could create your own custom row control ocx and use the DataRepeater to make it into a grid.
VB.NET does not provide a DataRepeater but you may still be able to import the DataRepeater into a NET project and do it that way.
|
|
|
|
|
i use a module containing the sub main.
in this module there's notifyIcon and an object (objX) of Form (X).
doing one of these:
objX.Visible=true
or
objX.Hide=true
causing all of the application to treminiate
is there and way to hide the form without minimizing it and closing the appliction.
with considering the notifyIcon.ContextMenu has a show menuItem and Hide MenuItem?
militiaware - VB.NET
Militiaware
|
|
|
|
|
Override your startup form's OnLoad sub and set it's Visible property to False. If that doesn't work for you, set your form's Opacity to 0. If you need to show the form again, either set Visiblity = True or Opacity = 1.
Public Class Form1
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e)
Me.Visible = False
Me.Opacity = 0
End Sub
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok, so i have a rich text box, txtMain. i need to add a sub that changes the text i specify to bold face. but format cant' do it. and the way the designer does it changes all the text instead of just some. is there a way to specify what text is bold? and maybe incorporate a Font dialog also?
|
|
|
|