|
i need code for retreving user DSN's which are created in system
|
|
|
|
|
C# desktop application will not start when using non-administrative user. Suspect permissions issue, but cannot pinpoint. Please help. Appears to be related to .jpg background image on main form. Here is the start of the error received (cannot reproduce in IDE, so cannot cut and paste):
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.DllNotFoundException: Dll was not found.
at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)
at System.Drawing.SafeNativeMethods.Gdip.Initialize()
at System.Drawing.SafeNativeMethods.Gdip..cctor()
--- End of inner exception stack trace ---
<snip>
at applicationName.Properties.Resources.get_background()
at applicationName.frmMain.InitializeComponenet()
at applicationname.frmMain..ctor()
at applicationName.Program.Main()
Have resinstalled .Net framework 3.5 and set full folder and file permissions available to all users on the .net framework folders as well as to our application folder, to no avail.
Any suggestions would be greatly appreciated.
|
|
|
|
|
i have created function in class file.
Public Shared Function dsCntrctET() As DataSet
Dim sqlCntrct As String = "Select * from CNTRCT_ET where CNTRCT_ID=" & CISCNO
Dim cmdCISContract As New OracleCommand
Dim daCISCntrct As New OracleDataAdapter
Dim dsCISCntrct As New DataSet
Dim cmdCISBuilder As New OracleCommandBuilder
Try
With cmdCISContract
.Transaction = myTransCIS
.CommandText = sqlCntrct
.Connection = cnCIS
End With
daCISCntrct = New OracleDataAdapter(cmdCISContract)
daCISCntrct.FillSchema(dsCISCntrct, SchemaType.Source)
cmdCISBuilder = New OracleCommandBuilder(daCISCntrct)
With daCISCntrct
.TableMappings.Add("Table", "CNTRCT_ET")
.Fill(dsCISCntrct)
.SelectCommand = cmdCISContract
.InsertCommand = cmdCISBuilder.GetInsertCommand
.UpdateCommand = cmdCISBuilder.GetUpdateCommand
.DeleteCommand = cmdCISBuilder.GetDeleteCommand
End With
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Return (dsCISCntrct)
End Function
it returns dataset that i can use for getting value from table.
but while saving data, i have to use dataadapter for da.update(ds,"table") and ds.acceptchanges.
this i have to use in multiple forms as this data comes from 3rd party so i dont want to write this in every form . so i thought how to return data adapter and dataset from the same function. as i wanted to use daCISCntrct and dsCISCntrct.
|
|
|
|
|
Don't cross post in multiple forums.
Have a look at out parameters.
|
|
|
|
|
I need help on how to build an sms web portal for e-evegenlism, for my church,please i need the source code.
Thanks
|
|
|
|
|
abbah wrote: please i need the source code.
Ummm...it doesn't work that way. This is part where YOU write the code. We'll help when you run into a specific problem. But, noone is going to write your code for you.
|
|
|
|
|
Dave Kreskowiak wrote: This is part where YOU write the code
True, I could tease him by saying I've got full source code for such project but it is so buried in a stack of CDs in my garage that it'll take me about 2 years to find it
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
< this contains the original Lounge post and content of material I deliberately left out of the Lounge post : feeling it was more appropriate here >
Hi,
I'm delighted to see that Jeff Anderson his taken latest version of AlphaForm[^], which was being sold as shareware, and now made it available to us, under the Code Project license, free !
I've created a "stress test" example of using Jeff's code that will move quite smoothly with virtually zero flicker, at run-time on an older system with no graphics card (i.e., using motherboard/CPU integration of all rendering) : PIV single core, 2.93 mhz, XP Pro SP 3, VS Studio 2010 beta, FrameWork 4.0, which I consider excellent since the load on the CPU for calculating the non-rectangular clipping regions must be high.
This example uses a .png bitmap saved in PhotoShop CS 4 as 24-bit .png with transparency, size 800x600, which includes one main content area, and two other content areas which are disconnected from the main content area (i.e., the form has non-overlapping areas of transparency : contains "holes") : inside this form there are two torodial areas cut-out from the main content area through which the underlying WinForm can be shown, and on which controls to be used at runtime can be placed. The source graphics (the complete images, source and the image mask files) I have optimized down to under 500k total using very valuable hints and tips found here[^]. I suspect further optimization is possible (particularly on the mask image, and I am experimenting with that trying to find the optimum level of reduction possible).
You can see the source image I'm using here[^], and the clipping mask image here[^].
These images are based on an excerpt from an image[^] in the public domain shown on Wikipedia, they are not original. The image is from a detail of a bronze frieze dating back probably a least 2000-2200 years ago, at Sarnath in India, showing the teacher born as Siddhartha of the Sakyas, and later known as Gautama the Buddha, giving what has become known as the "turning of the wheel" teaching that is believed, by Buddhists, to have "set in motion" (in a non-singular way [from the Theravadan Buddhist point of view]) the insights and practices that have led to what we now know as Buddhism. I was in Sarnath in October of 1975, and had a wonderful time there, even saw a live deer in the park !
If I reach the point where I feel I have enough mastery of Jeff's code that I can modify a few things, and have something substantial to say about using that modified version, or feel I have something useful to add about how to optimize use of it (or its source graphics files), I'll do a brief write-up, and post a link to it here (the WinForms forum) : hope you might do likewise if you use it and modify it.
So, thanks Jeff !
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
modified on Sunday, July 19, 2009 9:17 PM
|
|
|
|
|
I have a user control that contains a textbox control. I am getting some data from serial port. Anytime i get this data I need to raise keypress event of the user control that should internally riase keypress event of text box. I am a newbie to winforms and will very much appreciate if someone can walk me through steps on how to do this.
|
|
|
|
|
Hi,
two comments:
1.
are you sure you want KeyPress events? if all you want is append some text to a TextBox, why not use the TextBox.AppendText() method?
2.
if you use SerialPort.DataReceived event, you must be aware that event does not fire on the main/GUI thread; hence you cannot directly touch GUI Controls, you will need Control.InvokeRequired and Control.Invoke. If those are unfamiliar, search for InvokeRequired.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks for your response. My real problem is much more complicated so I am just used a simple example. All I basically need is to know how can I programatically raise keypress event of a text box that is contained within a user control. Any code example will be highly appreciated
|
|
|
|
|
Any ideas about this guys? I really need it very urgently.
TIA
|
|
|
|
|
Hi everyone,
I am new to code project , sorry if i place the question in wrong area. I am struck by a problem while using threads. In my windows project I have MDI form and shows different forms in the MDI form.In one form i am sending mails. i am sending the mails in a separate process using threads to enable the user to do anything in the application while sending the mails.one progress bar will appear in the mdi form status strip, when mail is sending.
When user clicks the Send button in the form i make it disable until the mail is sent.Before calling thread i make it disable and after completion of thread's work i make it enable, it works fine. but my problem is, When user opens this form and send mails, if he visits another form and again comes to this form i am checking in the form load whether thread is going on, by check whether progress bar is visible in the mdi form , if it is visible i make the send button disable. I need the send button enable after thread completion, i make it. but it is not working. the send button is still disabled.I don't know why it is happening. if user remains in the same form it is working fine. if he visits another form it is not working. I am using thread invoke method for using the controls. but still the problem is there.
Please any one help me
Thanks in advance.
Rajesh.
|
|
|
|
|
Hi,
threads can't access Controls directly, only the main thread can. You need one of two things:
1. use the Control.InvokeRequired/Control.Invoke pattern (search for InvokeRequired in CP articles)
2. or use a BackgroundWorker instead of a Thread; that one has InvokeRequired built-in into its ReportProgress and WorkCompleted events.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks for reply,
I am using Invoke method, still problem arises. Actually while i start a thread from the form i am able to enable the button but once if i visit another form and again returns to the this form while the thread is running the button is not enabled in the thread. why iam not able to do it. i think u understand ny question .please let me know. waiting for ur reply.
Regards,
Rajesh.
|
|
|
|
|
sekhar.k wrote: i think u understand ny question
apparently not. you did something wrong or didn't tell an essential part of the story.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
HI All,
I am working with WINPE1.6 to capture the Windows Server 2003 Image. But I am landing with the problem "fail to create XMLdoc, MSXML2::DOMDocument not found".
I have registered msxml2, msxml3, msxml3r, msxml6 and msxml6r in pe mode. But still same error we are getting.
Actullay we are booting the system im PE mode and trying to capture the image with winpe 1.6 (WINPE2.0 is not supporting for windows server 2003). But getting the above specified error.
Any Idea why this error is coming and please provide me the solution.
Thanks in Advance,
AR Reddy
|
|
|
|
|
I want to build a new windows distributed application (server/ Client). The client (.NET envoirnment)will be at a remote place outside the city (at any place) that shall be able to interact with the server for saving or retrieving data. On the server side the same application will be performing same tasks as the client side on LAN. There will be layers such as GUI,DAL,BLL(Bussiness logic), Controller and Data Types
1. Is it possible to have a same windows application at both sides (client and server )as i am presuming it to be?
2. What mechanism will be used for transporting data between the server and client
will it be a static IP address and http or something else i dont know?
3. Windows remorting or Web services will be useful for that?
i hope it will not bother anybody to help me.New to dot net so wanted to share and recieve ideas thanks
Thank every helper
|
|
|
|
|
***************************
For the record this is a cross-post.
I dont want to get anyone mad it's
just that i really need help with this
Original Post[^]
***************************
Hey All,
I am experiencing a strange issue, i have built and tested my RegEx in Expresso but when I call it from my code (C#) I am not getting any matches. If i step through and grab the values from the variables and put those in Expresso it works ....
RegEx:
<br />
Lead\sID\sNumber:\s*(?<LeadNumber>[^\r\n]*)(?:\r\n)+<br />
Prospect\sName:.*(?:\r\n)+<br />
Prospect\sContact:.*(?:\r\n)+<br />
Prospect\sPhone:.*(?:\r\n)+<br />
Marketing\sCampaign:.*(?:\r\n)+<br />
Prospect\sInformation:\s*(?:\r\n)+<br />
===============\s(?:\r\n)+<br />
(?<Company>[^\r\n]*)(?:\r\n)+<br />
(?<Address1>[^,]*),\s(?<Address2>[^\r\n]*)(?:\r\n)+<br />
(?<City>[^,]*),\s(?<State>[^\r\n]*)(?:\r\n)+<br />
(?<Country>[^,]*),\s(?<Zip>[^\r\n]*)(?:\r\n)+<br />
Contact\sName:\s*(?<FirstName>[^\s]*)\s(?<LastName>[^\r\n]*)(?:\r\n)+<br />
Contact\sPhone:\s*(?<Phone>[^\r\n]*)(?:\r\n)+<br />
C#:
<br />
MatchCollection myMatches = Regex.Matches([Text], [RegEx], RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace | RegexOptions.CultureInvariant);<br />
[Text] = the body of an email
[RegEx] = the above pattern
Any input or ideas would be greatly appreciated.
|
|
|
|
|
Hi,
I would debug such beast using "binary search", i.e. throw away half of the search specification, and keep doing that until something matches. Then you know the problem is in the part you last removed.
OTOH I would never come up with such a complex Regex pattern in the first place. It is just unreadable. And what happens if someone somewhere decides to add/delete a space, a new line, whatever to the e-mail format?
IMO you need several smaller operations to extract the fields individually, your code looks like a maintenance nightmare to me.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hello Luc,
Normally i would agree with you 200%, however this is a subcontract project which is going to be used by other developers. They wanted me to allow for configuration of the email parsing by having a setting which contains the RegEx to use.
You can find the solution to my problem here[^], i didn't want to keep cross posting.
Thanks again for your input.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
That's interesting. Thanks.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Is it possible (and how) to make an user control with a panel and make it a container (so that I can drop other controls on it at design time?
Or if it is simpler
If i place a button on the usercontrol - what do i need to do so i can click it at design time?
What is the point in reading a book about the future when it is allready the past.
|
|
|
|
|
Yes it is possible. A thread here[^] has the same thing as you need.
modified on Wednesday, July 15, 2009 12:38 AM
|
|
|
|
|
Hi Feudalac,
In addition to the thread that d@nish just referred you to, Henry Minute was inspired by that thread to publish an article here on CP exactly addressing this problem.
Designing Nested Controls[^]
I participated in that thread, and also illustrated one way to do this for one single usercontrol containing one container object, and you could, in theory, combine any number of these one-container-per-usercontrol objects at design time, but Henry's solution went far beyond mine in terms of practicality : his solution will let you do the same with multiple containers on one usercontrol.
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|