|
Dim cmd As OracleCommand
Dim ds As DataSet
Dim dv As DataView
Dim da As OracleDataAdapter = New OracleDataAdapter
' This does not work.. which is what I need, Country and State are entered by the user -
cmd = New OracleCommand("Select state_code, state_name, state_status" & _
" FROM m_state" & _
" WHERE country_code = :country_code AND state_code = :state_code", objConnection)
' -------------------------------------------------------------------------------------
' This works...-----------------------------------------------------------------------
cmd = New OracleCommand("Select state_code, state_name, state_status" & _
" FROM m_state" & _
" WHERE country_code = 'USA' AND state_code = :state_code", objConnection)
' -------------------------------------------------------------------------------------
' This works...-----------------------------------------------------------------------
cmd = New OracleCommand("Select state_code, state_name, state_status" & _
" FROM m_state" & _
" WHERE country_code = :country_code AND state_code = 'FL'", objConnection)
' -------------------------------------------------------------------------------------
' Parameter for State Code...
cmd.Parameters.Add("state_code", txtState.Text)
' Parameter for Country Code...
cmd.Parameters.Add(":country_code", txtCountryText)
da.SelectCommand = cmd
' Bind Fields..
ClearBinding()
' Initialize a new instance of the DataSet object...
ds = New DataSet
' Fill the DataSet object with data...
da.Fill(ds, "m_state")
' Set the DataView object to the DataSet object...
dv = New DataView(ds.Tables("m_state"))
' Set Bindings
txtStateName.DataBindings.Add("Text", dv, "state_name")
txtStatus.DataBindings.Add("Text", dv, "state_status")
|
|
|
|
|
I've write code two style but the same function on my application (Window Application)
1- my form has been load data from table in database in to DataTable and bind dataTable to dataGridView Controls.
in this form need to do any function like insert delete update query..
style one:===================================================================
Public Shared Sub addNewProduct(ByVal p As product)
Try
cmdAddProduct.CommandType = CommandType.StoredProcedure
cmdAddProduct.CommandText = "NewProduct"
cmdAddProduct.Connection = database.cn
With cmdAddProduct.Parameters
.Add("@PCode", SqlDbType.VarChar, 20).Value = p.ProductCode
.Add("@BCode", SqlDbType.VarChar, 30).Value = p.BarCode
.Add("@Des", SqlDbType.VarChar, 50).Value = p.Description
.Add("@Unit", SqlDbType.Int).Value = p.Unit
.Add("@UnitPrice", SqlDbType.Float).Value = p.UnitPrice
.Add("@Stock", SqlDbType.Int).Value = p.StockBalance
.Add("@photo", SqlDbType.Binary).Value = p.Photo
.Add("@sms", SqlDbType.VarChar, 50).Direction = ParameterDirection.Output
End With
cmdAddProduct.ExecuteNonQuery()
cmdAddProduct.Dispose()
Catch ex As Exception
Throw ex
End Try
End Sub=======================================================================
for example style two=========================================================
internal static void Add(Customer value)
{
try
{
//data is dataTable
DataRow row = data.NewRow();
row[0] = Customers.NextID();
row[1] = value.name;
row[2] = value.ssn ;
row[3] = value.phone ;
row[4] = value.address ;
data.Rows.Add(row);
da.Update(data);
}
catch (SqlException) { throw; }
}
Could you tell me which one is better for working with biggest database?
lyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambo.
|
|
|
|
|
I'd vote for the first one. The reason is that a DataTable loads all rows into memory, whilst the first one just creates a command and executes that.
I are troll
|
|
|
|
|
I am using mmc control for voice recording. I facing this error when i click mypage.aspx
Server Error in '/' Application.
--------------------------------------------------------------------------------
Retrieving the COM class factory for component with CLSID {C1A8AF25-1257-101B-8FB0-0020AF039CA3} failed due to the following error: 80040154.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {C1A8AF25-1257-101B-8FB0-0020AF039CA3} failed due to the following error: 80040154.
Source Error:
Line 17: public partial class SoundRecorder : System.Web.UI.Page
Line 18: {
Line 19: static MMControl mmc = new MMControl();
Line 20: static string file_name_path;
Line 21: protected void Page_Load(object sender, EventArgs e)
Source File: d:\dictaweb\SoundRecorder.aspx.cs Line: 19
Stack Trace:
[COMException (0x80040154): Retrieving the COM class factory for component with CLSID {C1A8AF25-1257-101B-8FB0-0020AF039CA3} failed due to the following error: 80040154.]
SoundRecorder..cctor() in d:\dictaweb\SoundRecorder.aspx.cs:19
[TypeInitializationException: The type initializer for 'SoundRecorder' threw an exception.]
SoundRecorder..ctor() +0
ASP.soundrecorder_aspx..ctor() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a9900e7d\6c99d8fd\App_Web_mwchlycg.20.cs
__ASP.FastObjectFactory_app_web_mwchlycg.Create_ASP_soundrecorder_aspx() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a9900e7d\6c99d8fd\App_Web_mwchlycg.28.cs
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +49
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +115
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +139
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
|
|
|
|
|
help!
tell me the reasons
|
|
|
|
|
coderormnger wrote: help!
tell me the reasons
You may find that you get more help if you form your question clearer, and with a little more humility. While I appreciate that English may not be your first language, this reads like a command and we aren't here to serve you - a "please" wouldn't go amiss.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
in am sorry to everyone,
my english is very pool, actually i am humility. please understand me.
and this question is resolved. thanks to everyone.
i think i must advance my english. ^_^.
|
|
|
|
|
Good reply.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
thank you , hehe.
i think you must be a superior of coding.
can you tell your nationality? i want know where are superiors from. ^_^
|
|
|
|
|
I'm from the UK.
coderormnger wrote: i want know where are superiors from. ^_^
They're from wherever talented people are. By studying hard, and living, sleeping, eating and breathing computing, you'll be well on your way.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
is UK Britain? i think it is.
a great country, many beatiful girl, like Victoria(wife of david.beckham),haha.
|
|
|
|
|
coderormnger wrote: i think i must advance my english.
Stick around. We'll help. Most of us are pretty decent people, and none of us (that I know of) has any grudge against "foreigners." Given the international membership, we're all foreigners somewhere. Over the years I've seen many members drastically improve their English skills by posting questions, answering questions, and asking for clarifications. The only way to learn a language - even non-computer languages - is to use it often, and to associate with people who know it better than you.
As a start, let me rephrase your post:
"My English is very poor. Actually I am humble. Please try to understand me.
This question has been resolved. Thanks to all of you.
I think I should improve my English."
Good luck, and welcome to the best collection of intelligent people I've ever found on the Internet.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
great replay, thank you. hoho~
|
|
|
|
|
I have been going over most of the examples (in VB .NET) on the internet on the produtcion of an RTD server and I have managed to create the server and publish data across the network, but I cannot figure out how the client would publish data back to the server for other clients to obtain. Any help would be greatly appreciated.
Thanks
Mark
|
|
|
|
|
I know noone has replied yet, but I still live in hope. Does anyone know the equivalent of getting data from an excel cell to be published via RTD. Basically I want the equivilent to DDE from VB6 (code bellow) where the windows form textbox can be linked to the cell. Since DDE is not supprted anymore, I am looking to replace the code. Any help would be greatly appreciated:
Text1.LinkMode = 0
Text1.LinkTopic = "Excel|MyBook.xls"
Text1.LinkItem = "R1C1:R2C3"
Text1.LinkMode = 1
'Poke the text in Text1 to the R1C1:R2C3 in MyBook.xls
Text1.Text = "one" & vbTab & "two" & vbTab & "three" & vbCr & _
"four" & vbTab & "five" & vbTab & "six"
Text1.LinkPoke()
'Execute commands to select cell A1 (same as R1C1) and change the font
'format
Text1.LinkExecute("[SELECT(""R1C1"")]")
Text1.LinkExecute("[FONT.PROPERTIES(""Times New Roman"",""Bold"",10)]")
'Terminate the DDE communication
Text1.LinkMode = 0
|
|
|
|
|
I have an issue with command builder
below is the code
Public Structure SearchandUpdateClaimDetail
Private cnConnection As System.Data.SqlClient.SqlConnection
Private cmdCommand As System.Data.SqlClient.SqlCommand
Private adAdapter As System.Data.SqlClient.SqlDataAdapter
Private ds As System.Data.DataTable
Sub New(ByVal ConnectionString As String)
cnConnection = New SqlClient.SqlConnection(connectionstring)
cmdCommand = New SqlClient.SqlCommand
adAdapter = New SqlClient.SqlDataAdapter
ds = New DataTable
End Sub
Public Function SearchClaimDetail(ByVal SearchQuery As String) As DataTable
ds.Clear()
cmdCommand.Connection = cnConnection
cmdCommand.CommandText = SearchQuery
adAdapter.SelectCommand = cmdCommand
adAdapter.Fill(ds)
cnConnection.Close()
Return ds
End Function
Public Function UpdateClaimDetail(ByVal DTTable As DataTable) As Boolean
Dim sqcmdb As New SqlClient.SqlCommandBuilder(adAdapter)
adAdapter.Update(dttable)
cnConnection.Close()
Return True
End Function
End Structure
this structure is in a class. i call this structure (function SearchClaimDetail) in another class (BLL) which exposes its function to GUI which binds the grid.
Now when i modify the datatable and sends it back (function UpdateClaimDetail)to update the database it goes smoothly but does not update the database nor it gives any error. There is one primary key in the table which is used in the select command.
How can i update the table. I do not want to insert the rows but to update existing rows.
|
|
|
|
|
I want to copy all embedded resource to given folder
pls give me a working sample code.
pls help me
|
|
|
|
|
It's may be helpful for u.
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BBl));
Pic1=resources.GetObject("a");
Pic1.save("C:\ja.bmp");
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
let me know is it possible to lock Netwok Connections And My Network Places as soon i start the system.if user try to to click on these .....it should not open ...until i give password or permission to it
Using VB.Net Windows Application.
Task: As soon As I run My Exe in registry or start Up ....It Should Not allow the user to enter in to the MY Network PLaces and Network Connections of Control PAnel. once user provided with credentials then they are allowed to access those Network Connections and My Network Places......
Just I want to restrict on those icons Directories not on individual Internet Connection or Wlan Connection ....just lock those things(MyNetworkPlaces, NetworkConnections) as soon as i start my System
plz let me know in what manner i have to proceed....
i tried but unable to do it......
|
|
|
|
|
|
You can use WiX[^] to make the installation packages (requires some learning). Or you can use other programs to do so, some are free and others are not.
If you want to create a bootstrapper, you can use MSBuild (included in the .net framework) or use other bootstrapper generators.
Eslam Afifi
|
|
|
|
|
you can use software to help this problem that made project to file setup .
there are alot of software but I khnow some of them such as :
InstallShield X , Seup Victory ..
lyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambodia
lyrithyforcambodialyrithyforcambodia
lyrithyforcambo.
|
|
|
|
|
Hello,
I have a UserControl that contains a tab control that has about 8 pages.
Each pages have a lot of controls and all 8 pages need to be loaded at the same time.
The UserControl is opened when a user click on a button from the main form.
I searched the entire CodeProject for splashscreens or good loaders, but I didn't find anything useful. Can someone guide me on how to load the usercontrol without hanging the application.
I don't mind if it takes 10 seconds, but I would like a loader in this time, without freezing the entire application.
Hope you can help,
Thank you
|
|
|
|
|
The problem you have is it takes so long to load the form because you have sooooo many controls. Reduce the number of controls, such as scrapping the tab page layout and moving them to seperate forms that you only load when you absolutely need to show them (you have 8 tabs remember, you can only see one tab at a time!)
You have a second problem. Since all the controls must be created on the UI thread in order to work properly, showing a "Progress Bar" (not "loader") isn't going to work very well, because it also gets drawn on the UI thread, which will be too busy creating your large number of controls, and hence, won't be able to show "progress".
|
|
|
|
|
Dave Kreskowiak wrote: second problem.
The way I handle this seems to work perfectly:
- first create the splash form, make it TopMost and show it modelessly; a simple splash appears right away and holds a progress bar, a listbox showing what is going on, and a cancel button. Plus all the aesthetics one might want to add.
- then construct the slow form and pass a reference to the splash form to it, so it can add items to the activity listbox, advance the progress, and when loaded close the splash (with a small delay so you still can read the latest listbox updates).
I have a SplashWindow class that supports this, and I tend to use a using construct for the splash so it also disappears when something goes wrong during the main forms construction.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|