|
**my update statement in my oracle em package
**my update button code
Dim applyprogram As BLL.CApplyProgram = New BLL.CApplyProgram
Dim loanapplication As BLL.CLoanApplication = New BLL.CLoanApplication
applyprogram.ApplyStreamID = Viewstate("APPLYSTREAMID")
applyprogram.laCountryID = ddlCountry.SelectedItem.Value
applyprogram.laFieldID = ddlStudyFields.SelectedItem.Value
applyprogram.laInstituteID = ddlInstitute.SelectedItem.Value
applyprogram.laStreamID = ddlStream.SelectedItem.Value
applyprogram.laProgramID = ddlProgram.SelectedItem.Value
loanapplication.APPID = ViewState("APPID")
loanapplication.LACPROGID = ddlProgram.SelectedItem.Value
loanapplication.LACCOUNTRYID = ddlCountry.SelectedItem.Value
loanapplication.LACSTREAMID = ddlStream.SelectedItem.Value
loanapplication.LACFIELDID = ddlStudyFields.SelectedItem.Value
loanapplication.LACINSTITUTEID = ddlInstitute.SelectedItem.Value
loanapplication.LASTARTEDUCATION = CCommon.MyFormatDate(txtStartDate.Text)
loanapplication.LAYEAREDUCATION = txtYearEducation.Text
loanapplication.LADURATIONYEAR = txtDurationYear.Text
loanapplication.LADURATIONMONTH = txtDurationMonth.Text
applyprogram.Save(BLL.UpdateType.Update)
loanapplication.Save(BLL.UpdateType.Update)
CCommon.CreateMessageAlert(Me, "Record Updated Successfully",
"PromptMessage")
** only few fields (end with smileys) updated
** no error msg
|
|
|
|
|
Ok. This isn't complete by any means. All this does is set a bunch of properties. We'd need to see the code that's behind the Save methods. What does the actual updates to the database?
|
|
|
|
|
hi habibah
What Exactly are you updating ?
Post us your code and point to the Error.
i have once Written an Article about your problem, but that article is for Newbies, for now it will help you
http://www.codeproject.com/KB/vb/N-Tier_Application_VB.aspx[^]
Hope it helps and dont forget to vote for my Article
Thanks
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
|
|
|
|
|
anyone out there who can help me develop a very,very simple game of snake using VB.NET? it is due tomorrow so i really need your help...
it must be until Level 3...
tnx in advance...God bless...
|
|
|
|
|
sakhura_31 wrote: help me develop a very,very simple game of snake using VB.NET?
Maybe we could help if you asked a more specific question about where your stuck.
sakhura_31 wrote: it is due tomorrow so i really need your help...
I certainly hope you started this project at least a couple of weeks ago...
|
|
|
|
|
sakhura_31 wrote: is due tomorrow so i really need your help.
When you fail this assignment, stop and consider if you want to pursue Computer Science or not. IF you do, then do your own homework instead of going out drinking, when it is assigned to you. By all means, if you do your homework and get stuck on specifics, ask here.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am developing an application which i am using crystal report as reporting.
i am getting exception despite i added crystal report .dll in reference.
You are the most welcome to assit me in solving this problem.
Abdul Rahaman Hamidy
Senior Student Student in Computer Science, Kabul, Afghanistan
Interesed in Software Development
|
|
|
|
|
Abdul Rahman Hamidy wrote: You are the most welcome to assit me in solving this problem.
We'd love to help, but you haven't told us what the problem is, other than "I'm getting an exception." What's the exception message?? Without that, we're just guessing at the hundred of possible exception messages you may be getting.
|
|
|
|
|
What error message are you getting? Can you give us a sample of the code that is causing the error? We can't help if you don't give us more information.
|
|
|
|
|
I am trying to work out a simple COM/.NET interop code. In my project in VB, I have created a simple windows application to add two numbers. The functionality of adding is done through the help of a .NET DLL written in C#. I am quite confused by trying various ideas sugggested by people. Can anyone clarify this simply in a step by step fashion?
This my VB code:
<br />
<br />
Private Declare Function method Lib "C:\Documents and Settings\CSfiles\interop\interop\bin\Debug\interop.dll" Alias "interopdll" (ByVal X As Integer, ByVal X As Integer)<br />
<br />
Private Sub Command1_Click()<br />
<br />
Dim a As Integer<br />
Dim obj As Object<br />
<br />
obj = New sample ' I get a compile-time error for undefined user type here.<br />
<br />
a = obj.method(CInt(Text1.Text), CInt(Text2.Text))<br />
Label1.Caption = CStr(a)<br />
<br />
End Sub<br />
<br />
My C#(.NET DLL) Code:
<br />
<br />
using System;<br />
using System.Runtime.InteropServices;<br />
using System.Reflection;<br />
<br />
[assembly: ComVisible(true)]<br />
namespace interop<br />
{<br />
<br />
[ClassInterface(ClassInterfaceType.AutoDual)]<br />
<br />
[GuidAttribute("6CE9C732-CD90-4042-A5F0-CF71DFAC2598")]<br />
<br />
class sample<br />
{<br />
public sample()<br />
{<br />
}<br />
public int c;<br />
<br />
public void method(int a, int b)<br />
{ <br />
c = a+b;<br />
} <br />
}<br />
}<br />
<br />
In this I have registerd the DLL with /codebase switch while using regasm.exe too.
Regards,
Lenus.
|
|
|
|
|
SPanicker* wrote: Private Declare Function method Lib "C:\Documents and Settings\CSfiles\interop\interop\bin\Debug\interop.dll" Alias "interopdll" (ByVal X As Integer, ByVal X As Integer)
Private Sub Command1_Click()
You cannot call a .NET dll from VB6 like this. The .NET compilers don't generate the exports needed for VB6 to call library functions like this.
You'll have to partially scrap the VB6 code and rewrite it along with rewriting the C# .DLL.
The .DLL has to be rewritten so that it's functionality it exposed through COM, if it's not already. Then you can add a reference to the COM-registered .DLL in your VB6 project and call the classes and methods through the COM interface.
|
|
|
|
|
Hi Dave,
Thanks for the info.
Can you just explain this a bit more? Tht is, can you just put the idea across through some demo? Or just provide me with some useful link where I can start up with such a basic tutorial or so?
Regards,
Lenus.
|
|
|
|
|
|
Hi,
I have to run a windows service in .net in which i have to generate popup message box reminder every one hour. i dont want to run it as a application, as each and every time we have to run it manually daily. i cant find a message box in windows service. can anybody please give me an idea of how to do it in an automatic service so that no manual process should be done. once they switch on the system, the service should start automatically and should generate popups once an hour. Pls help.
Thanks and Regards
Vijayarajan.V
|
|
|
|
|
vijay_83 wrote: I have to run a windows service in .net in which i have to generate popup message box reminder every one hour.
Not possible. Web Services cannot generate any kind of a user interface what-so-ever.
<blockquote class="FQ"><div class="FQA">vijay_83 wrote:</div>once they switch on the system, the service should start automatically and should generate popups once an hour.</blockquote>
This sounds like you're trying to write a Windows Service, not a Web Service.
|
|
|
|
|
I currently have a VB6 program to capture packets and can filter by MAC address. There are only monochrome image files of about 15kb in size sent over the line. I am trying to add code to reassemble the data portion of the packets into the original image to display it.
Has anyone had any success coding a packet reassembly program. I'd appreciate any advice, thanks
|
|
|
|
|
I've written something similar for school before, but for text message. The hard part is figuring out how to pull the packets and you seem to have the packets pulled in anyhow. It's just a matter of understanding tcp/ip/ethernet protocol to read the correct bits to order the packets and reassemble the message.
It's been a while since that project, but if you have specific problems, you can post it and people will help you.
|
|
|
|
|
i have 2 problem
the first is:
i am dealing withe database my connection is
Public ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
"Data Source =" & Application.StartupPath & "\ITDSS.mdb"<br />
Public con As New OleDbConnection(ConStr)
i am deleting from it and it work smile.gif smile.gif
but after i close my project than i open it and i made run i found that the deleted record in the database ohmy.gif
after i delete i check only the database in the dubg file
how can i make it delete for ever
is the rong in the connection
the code is deleting and inserting will its runing after i close the project and rerun it agen in the database i found the deleted record
also i but the database in the debug fill but i found it in many folder insad my project fill
<br />
Dim sql As String = "SELECT * FROM [Section]"<br />
Dim sql2 As String = "SELECT * FROM Slot"<br />
Dim da As New OleDbDataAdapter(sql, con)<br />
Dim da2 As New OleDbDataAdapter(sql2, con)<br />
Dim ds As New DataSet<br />
Dim ds2 As New DataSet<br />
da.Fill(ds, "Section")<br />
da2.Fill(ds2, "Slot")<br />
Dim InsertCommand1 As New OleDbCommand<br />
Dim InsertCommand2 As New OleDbCommand<br />
con.Open()<br />
InsertCommand1.Parameters.Clear()<br />
InsertCommand1.Connection = con<br />
InsertCommand1.CommandText = "DELETE FROM [Section] WHERE SectionID=" & ComboBox105.Text<br />
InsertCommand1.CommandType = CommandType.Text<br />
InsertCommand1 = InsertCommand1<br />
Me.BindingContext(ds, "Section").EndCurrentEdit()<br />
da.Update(ds, "Section")<br />
InsertCommand1.ExecuteNonQuery()<br />
<br />
'to delet all the slot for the deleted section<br />
InsertCommand2.Connection = con<br />
InsertCommand2.CommandText = "DELETE FROM Slot WHERE SectionID=" & ComboBox105.Text<br />
InsertCommand2.CommandType = CommandType.Text<br />
InsertCommand2 = InsertCommand2<br />
Me.BindingContext(ds2, "Slot").EndCurrentEdit()<br />
da2.Update(ds2, "Slot")<br />
InsertCommand2.ExecuteNonQuery()<br />
con.Close()<br />
i delete from tow table
and this for insert
con.Open()<br />
Dim sql As String = "SELECT * FROM [Section]"<br />
Dim sql2 As String = "SELECT * FROM Slot"<br />
Dim da As New OleDbDataAdapter(sql, con)<br />
Dim da2 As New OleDbDataAdapter(sql2, con)<br />
Dim ds As New DataSet<br />
Dim ds2 As New DataSet<br />
da.Fill(ds, "Section")<br />
da2.Fill(ds2, "Slot")<br />
Dim InsertCommand1 As New OleDbCommand<br />
Dim InsertCommand2 As New OleDbCommand<br />
<br />
<br />
'---insrting section to section databace<br />
InsertCommand1.Parameters.Clear()<br />
InsertCommand1.Connection = con<br />
InsertCommand1.CommandText = "INSERT INTO [Section] ([SectionID],[CourseID],[Type],[TeacherID],[joinedSection],[Group],[Capacity]) VALUES (?,?,?,?,?,?,?)"<br />
InsertCommand1.CommandType = CommandType.Text<br />
InsertCommand1 = InsertCommand1<br />
Try<br />
InsertCommand1.Parameters.AddWithValue("?", Trim(CType(TextBox46.Text, Integer)))<br />
InsertCommand1.Parameters.AddWithValue("?", Trim(ComboBox99.Text))<br />
InsertCommand1.Parameters.AddWithValue("?", Trim(ComboBox102.Text))<br />
InsertCommand1.Parameters.AddWithValue("?", Trim(0))<br />
InsertCommand1.Parameters.AddWithValue("?", Trim(0))<br />
InsertCommand1.Parameters.AddWithValue("?", Trim(TextBox47.Text))<br />
InsertCommand1.Parameters.AddWithValue("?", Trim(0))<br />
da.InsertCommand = InsertCommand1<br />
InsertCommand1.ExecuteNonQuery()<br />
Catch ex As Exception<br />
MsgBox(ex, , "Alert")<br />
End Try<br />
Me.BindingContext(ds, "Section").EndCurrentEdit()<br />
da.Update(ds, "Section")
sorry about that but also i whant to ask about
can i update using this statment
sectionsforupdate.Tables("Slot").Rows(i).Item(0) = slot<br />
sectionsforupdate.AcceptChanges()<br />
|
|
|
|
|
asha_s wrote: how can i make it delete for ever
is the rong in the connection
For you to even ask that means you don't understand how databases work. You either connect, or you don't. If you're running the same version of the app ( release or debug ) both times, and your column disappears then reappears, it probably means that your UI is not showing it, but you never deleted it.
asha_s wrote: Dim sql As String = "SELECT * FROM [Section]"
Dim sql2 As String = "SELECT * FROM Slot"
Dim da As New OleDbDataAdapter(sql, con)
Dim da2 As New OleDbDataAdapter(sql2, con)
Dim ds As New DataSet
Dim ds2 As New DataSet
Your code would be easier to read if your variables had meaningful names.
asha_s wrote: ComboBox105.Text
You have 105 numbered combo boxes ? How do you know that combo105 is the right one ? This is probably your problem.
You're at least using paramerised queries, but it's still better to have a real data layer, IMO.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
my connection is
Public ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
"Data Source =" & Application.StartupPath & "\ITDSS.mdb"<br />
Public con As New OleDbConnection(ConStr)
please if you now how i can solve this problem help me
yes i have 105combobox because i am Dealing withe big tables
tell me how can i make the ui connect to the db
please i need your help
|
|
|
|
|
asha_s wrote: i am deleting from it and it work smile.gif smile.gif
but after i close my project than i open it and i made run i found that the deleted record in the database ohmy.gif
after i delete i check only the database in the dubg file
This is problably because the database file in your project is being copied to target build directories (Debug or Release) every time you run or rebuild the project, thereby overwriting the changes you made to the COPIES of database in those folders.
|
|
|
|
|
thinks it yes the file was a copy and it work now
but i want to ask about updating db can i use this way
If RichTextBox45.Text <> "" Then<br />
slot = 50405<br />
sectionsforupdate.Tables("Slot").Rows(i).Item(0) = slot<br />
i += 1<br />
End If<br />
sectionsforupdate.AcceptChanges()<br />
con.Close()<br />
becuse in table sectionsforupdate many record that have the sectionId
and the primary key is (slot,sectionid)
i want to update all the slot for that section
i bring all the record that have the sectionid and but it in sectionsforupdate without knowing the slotid i want to update the slot
so i but this code but its not working
please help me
|
|
|
|
|
AcceptChanges doesn't do what your code is implying that you think it does. AcceptChanges tells the dataset that all of the changes it's keeping track of should be permanent, IN THE DATASET - NOT THE DATABASE. Call the Update method to write the changes made to the dataset back to the database.
|
|
|
|
|
thanks but 'Update' is not a member of 'System.Data.DataSet'.
and i con not use the comand becase i have many slot that have the same sectionid and i retreve all of them and i want to update colum (0) row by row how can i save the changes
please help if you can becuse i stop my project and trying to solve this problem
|
|
|
|
|
Sorry, you call Update on the DataAdpater or TableAdatper that was used to fill the DataSet/DataTable.
|
|
|
|