|
My.Setting.Save() method works and saves what I need it to save. However, when I view the .config file the values in <usersettings>
<appname.my.mysettings> are not the same as those returned by the My.Settings.PropertyName
When you call the Save() method, does it not also save the changes to the config file?
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
There should be a folder within C:\Documents and Settings\user\Local Settings\Application Data or C:\Documents and Settings\user\Application Data folder i can't remember exactly where its at but if you browse those two locations, you should see a folder with your program name and in that should be your config file.
Hope that helps.
|
|
|
|
|
Hi,
I tought that defining EnableVisualStyles would give a XP style look to application. However in design time when I define a backcolor for a button, The glossy look of button disappears. In the mean while, I set the one button's backcolor to system.window color, the glossy look of the button disappeard and now I can't give glossy look to button.
The question is how I can make a button look glossy with a defined backcolor.
Thank You.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
In order to do this, you have to override the OnPaint event handler for the button, and do all the painting yourself.
VisualStyles for buttons is whatever the colour is set to in Windows itself.
There are loads of examples in CodeProject and on the Web. Search for something like 'Glass Button Visual Basic' for ideas on how to do it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
To enable Xp style look for the application go to project properties -> application tab. you will find "Enable XP visual Style" check box. recompile the application and it will work.
|
|
|
|
|
Hi all... I'm working on a report (Reporting Services) with an external image. The problem is it's not showing up. I'm passing the image through as a base64 string to the report and converting it back to bytes using the
Convert.FromBase64String function. The code is as follows
Dim location As String = Configuration.ConfigurationSettings.AppSettings("location")
Dim reader1 As New System.IO.StreamReader(location)
Dim base64 As String
Dim BinRead As New BinaryReader(reader1.BaseStream)
Dim file1 As New FileInfo(location)
base64 = Convert.ToBase64String(BinRead.ReadBytes(CType(file1.Length, Integer)))
Dim param As New Microsoft.Reporting.WinForms.ReportParameter("Image", base64, False)
Dim al As New List(Of Microsoft.Reporting.WinForms.ReportParameter)
al.Add(param) ReportViewer1.LocalReport.EnableExternalImages = True ReportViewer1.LocalReport.SetParameters(al) ReportViewer1.RefreshReport()
.
.
.
Please ignore the BinReader / Reader bit. I havn't fixed that up yet. If someone can please tell me why this thing is not showing an image. I would be very greatful.
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
First you should convert your stream to Bitmap object then you can put it on Picture Image.
Bitmap bitmap = new Bitmap (stream);
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
I have a text file that has similar lines.
there are 3 fields by which the similar lines can be identified.
modified 28-Nov-12 8:45am.
|
|
|
|
|
you have to define rules for "similar"
Is "jerry" similar to "jery" ??
is ABCD similar to ABBC or ACDC (BTW ACDC is very good band) ??
|
|
|
|
|
|
Read all strings in an array, and do a foreach .
I are troll
|
|
|
|
|
Read your Text file to Line wise. You should need of Two string Arrays.
First one you put your File's Unique Data.
Second You use it for Counter.
Then check one by one your data to array.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
Hay developers
In Visual studio 2005 in Crystal Report Editor you can find "Set datasource location...". There you can change everything (mapping, datasource, even dataprovider). So far so good, but if you want to change DATAPROVIDER runtime (in code) you have big problem. You can change datasource to other database on the same platform, but you cannot change ORACLE to SQL database ??
It seems that changing DATABASENAME doesn't do anything. This is understandable because ORACLE (i design report originaly for ORACLE) does't have database name, you just specified SERVERNAME, USERID and PASSWORD.
So I think the problem lies in fact that you cannot change PROVIDER runtime??
So basicaly I'm able to change provider from ORACLE to SQL in IDE with no problem but not on runtime
I try allmost everything and nothing works form me (see example below).
BTW I'm IT pro and I know what I'm doing, so don't answer to my question like "do you have SQL started" or "is your password writen correct"
no ofense
If you have hundrets of report you cannot do this thru IDE.
Please help
Best regards Jerry
<br />
Public Sub sub_ApplyInfo1(ByRef _oRpt As CrystalDecisions.CrystalReports.Engine.ReportDocument, _<br />
ByVal _dbName As String, _<br />
ByVal _serverName As String, _<br />
ByVal _userID As String, _<br />
ByVal _passWord As String, Optional ByVal _IntegratedSecurity As Boolean = False)<br />
<br />
<br />
Dim oCRDb As CrystalDecisions.CrystalReports.Engine.Database = _oRpt.Database<br />
Dim oCRTables As CrystalDecisions.CrystalReports.Engine.Tables = oCRDb.Tables<br />
<br />
Dim oCRTableLogonInfo As CrystalDecisions.Shared.TableLogOnInfo<br />
Dim oCRConnectionInfo As CrystalDecisions.Shared.ConnectionInfo = New CrystalDecisions.Shared.ConnectionInfo<br />
<br />
<br />
oCRConnectionInfo.IntegratedSecurity = _IntegratedSecurity<br />
oCRConnectionInfo.Type = ConnectionInfoType.CRQE<br />
oCRConnectionInfo.ServerName = _serverName<br />
<br />
If _dbName <> "" Then<br />
oCRConnectionInfo.DatabaseName = _dbName<br />
End If<br />
If _userID <> "" Then<br />
oCRConnectionInfo.UserID = _userID<br />
End If<br />
If _passWord <> "" Then<br />
oCRConnectionInfo.Password = _passWord<br />
End If<br />
<br />
For Each oCRTable As CrystalDecisions.CrystalReports.Engine.Table In oCRTables<br />
oCRTableLogonInfo = oCRTable.LogOnInfo<br />
oCRTableLogonInfo.ConnectionInfo = oCRConnectionInfo<br />
oCRTable.ApplyLogOnInfo(oCRTableLogonInfo)<br />
'Dim lcLocation As String = oCRConnectionInfo.DatabaseName & ".dbo." & oCRTable.Location<br />
Next<br />
<br />
'Dim cry_logOnInfo As New CrystalDecisions.Shared.TableLogOnInfo<br />
''Me.sub_ApplyInfo(oRpt, "FIN", "MYPC\SQLEXPRESS", "", "", True)<br />
<br />
'cry_logOnInfo.ConnectionInfo.ServerName = "MYPC\SQLEXPRESS"<br />
'cry_logOnInfo.ConnectionInfo.DatabaseName = "FIN"<br />
'cry_logOnInfo.ConnectionInfo.UserID = ""<br />
'cry_logOnInfo.ConnectionInfo.Password = ""<br />
'cry_logOnInfo.ConnectionInfo.IntegratedSecurity = True<br />
<br />
'Dim oTable As CrystalDecisions.CrystalReports.Engine.Table<br />
'For Each oTable In _oRpt.Database.Tables<br />
' oTable.ApplyLogOnInfo(cry_logOnInfo)<br />
'Next<br />
End Sub<br />
<br />
|
|
|
|
|
It's been a LONG time since I've had to do this, but if I remember right there are two things you have to watch, the difference in table names between sql/oracle and I believe you have to refresh the object after you change the provider via .refresh .verifydatabase. That should force it to load the right dlls for the currently assigned provider rather than the one saved with the report.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
For changing your datasource at run time in case of Crystal Report You can crete your Report connection through DSN.then create DSN as per your requirement.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
hi
modified 28-Nov-12 8:51am.
|
|
|
|
|
I didn't read the whole code but check the following
The cases that your code doesn't work are the names different in case (upper / lower case)
String comparison in .net is case sensitive so that might be the problem.
(use string.tolower or string.toupper on both strings that you are comparing to make it case insensitive)
|
|
|
|
|
thanks for that ...
will try it out
|
|
|
|
|
try this
If String.Equals("AAA", "BBB") Then
End If
BR
Jerry
|
|
|
|
|
Hi,
I did not like your post for several reasons:
1. it is not clear what you attempt to achieve. Why couldn't you explain what this is for, and give an example of some data, showing parts that work and parts that don't.
Applying some bold and italic is not the way to explain things.
2. your code looks terrible, I am not going to analyze it. Why can't you apply object-oriented principles to it? you have lines describing some kind of object, hence make that a class, and give it a method to create itself from a text line, and another method to output itself in a format of your choice.
Also try to limit the nesting of conditionals and loops, you have around 10 leading to long code lines requiring lots of horizontal scrolling. When properly coded, the main method would fit on a single screen and it would be much easier to spot the problem.
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
|
|
|
|
|
Hi everyone,
I have a form with only one button, "Send", to test the code to send SMTP emails.
It fires the click event when I hit the "Send" button, but the email is never sent if I leave the form running. When I close the form, the email is sent.
This is not the needed behavior because the User may never close the Application or the Form to send emails (this is a Client/Server application, not Web).
Does anyone have an idea why is this happening or what should I change in the code?
Below is the code behind the "Send" button's click event:
Dim message As New MailMessage()
Dim client As New SmtpClient()
'Set the sender's address
message.From = New MailAddress("paulog@corpdev09.com")
message.To.Add(New MailAddress("recipient-test@corpdev09.com"))
message.CC.Add(New MailAddress("paulo-second@corpdev09.com"))
'Set the subject and message body text
message.Subject = "This is the email subject"
message.Body = "This is the body of the email"
'Set the SMTP server to be used to send the message
'client.Host = "DEV-EXCP09-CORPDEV.COM"
'Send the e-mail message
Try
client.Send(message)
Catch exMessage As Exception
MessageBox.show("Error: " + exMessage.Message)
End Try
Thanks,
Paulo
|
|
|
|
|
Have you tried using SendAsync(message) instead of Send(message) ?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry,
Thanks for your answer. Yes, I changed the code and tried SendAsync with the same result in VB. I also got the below code snipe in C#:
private static void SendAynchronousEmail(SmtpClient client)
{
MailMessage message = new MailMessage();
message.To.Add(RecipientEmail);
message.From = new MailAddress(SenderEmail);
message.Subject = "Asynchronous Email Test";
message.Body = "This is a test email, sent asynchronously.";
client.SendCompleted += new SendCompletedEventHandler
(mailDeliveryComplete);
client.SendAsync(message, "Test");
Console.WriteLine("Sending finished, press Enter.");
Console.ReadLine();
}
It sends the email only after you hit Enter. If you remove the Console.ReadLine()the email is never sent!
The code in the mailDeliveryComplete just write in the console "Message Sent".
I'm lost.
All code snipes I see in books and Internet are straight forward like above but none works, only after you close the application.
Any idea what is missing?
Thanks,
Paulo
|
|
|
|
|
My guess is the Console is behaving in a logical way and you are fooling yourself. Whenever you execute Console.ReadLine() the console awaits your input and delays all its output. So "Message Sent" can not be shown as long as you don't hit ENTER.
To prove this, add the following right after Console.ReadLine():
Console.WriteLine("please hit ENTER once more");
Console.ReadLine();
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
|
|
|
|
|
Hi Luc,
Yes, you are right. But the point is not the command console.readline() but the fact that if I remove it the email is not sent.
In MSDN I found that if you use the synchronous Send method your code does not goes until the request is completed. This is why I'm using SendAsync that is asynchronous and it should not wait and send the email, not matter what the code does after.
I put the console.readline() only to be able to see the messages, I never tought that if I remove it the email is never sent.
Must be a reason for that...
Thanks for you reply. I'm still trying to find a way to send SMTP emails without having to finish the thread.
Thanks,
Paulo
|
|
|
|