|
Images can be inserted to the mail body by embedding them as linked resources.We need to first create an alternate view
Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(rtbContents.Text, Nothing, "text/html")
Next all images inserted to the mail body are embedded as linked resources to AlternateView with each image having a unique id.Next the alternate view is added to the MaiMessage object.
Once again thanx for all your responses
|
|
|
|
|
Hi, I am trying to create a function in vb .NET that can calculate the travel time from one point (P(x,y)) to another point(Q(x,y)) knowing the speed as a constant per squere. Exemple 1 square = 00:12:00.
When I calculate the distance between the 2 points, the result is a double, for example 4.32.
To get the travel time I need to multiply 4.32 by 00:12:00 (double, by datetime).
I have tried using Convert.ToDouble method and TimeSpan but i didn't manage to work with them.
How can this be achieved?
The end result should be in datetime format.
|
|
|
|
|
Hi,
a travel time is a TimeSpan, not a DateTime. (what would be the meaning of 08-JAN-2009 times two?)
The TimeSpan type offers Add methods but no Multiply methods, however it has a Ticks getter property so you can convert it to ticks, and it also has a constructor(ticks) so you can create a new TimeSpan with a new value.
modified on Wednesday, January 7, 2009 11:27 PM
|
|
|
|
|
Hi, thanks for the reply ...
I have converted the time in seconds (integer). This has helped me to multiply the time(s).
Then using the DateAdd(DateInterval.Second,seconds, date start) to calculate if you start from a date, from a point, when you will reach the next one, if you know the travel time in seconds.
Now it is clear for me...
|
|
|
|
|
I have created a setup project in VS2008. My WinForms app uses .NET 2.0, so I chose .NET 2.0 Prerequisity and built the setup project.
When I run my Setup.msi on a clean PC, it correctly detects that the .NET is missing and asks if it should be installed. After a successful installation of the .NET, the installer simply exits and doesn't continue with installation of my app (I think it should).
When I run the MSI file on a PC with .NET already installed, my app installs correctly.
Is there any way how to install .NET 2.0 and my app together in one step?
|
|
|
|
|
petrveit wrote: Is there any way how to install .NET 2.0 and my app together in one step?
It's already doing that. Must likely the .NET Framework requires a reboot before continuing with the setup
only two letters away from being an asset
|
|
|
|
|
Good afternoon,
i have one c# class known as EXTdata implementing IEXTAccess
i want to create an instance of EXTdata inside javascript function doScript().
my html code is here.
<title>Untitled Page
<object id="myControl1" name="myControl1" classid="EXTViewer.dll#EXTViewerLib.EXTViewer" width="100%" height="90%">
function doScript()
{
var filepath = document.getElementById("openFileDialog").value;
myControl1.SetIEXTAccess = <b>/* here should be instance of c# class new EXTdata(filePath); */</b>
return true;
}
i am not getting how to instantiate c# class implemeting some interface inside javascript
Any suggestion or sample code if any one have it.
Thanks in advance.
DaTtA.
way2datta@gmail.com
|
|
|
|
|
One way is to create a COM wrapper around the C# class.
The COM can then be instantiated in javascript using the ActiveXObject object.
«_Superman_»
|
|
|
|
|
Thanks a lot!!!!
but can i get tutorial or some thing that will help me to wrap the class inside COM.
|
|
|
|
|
|
Hi All,
OleDbDataAdapter.Fill(DataSet)
We do have a summary screen, displaying all books information using GridView from BookMaster Table in Access
DataBase.OleDbDataAdapter.Fill() method to fill dataset and bind the dataset to GridView. In Summary Screen, there is an option to insert data, of newly purchased Books.Once New Data is entered, it redirects back to summary screen.
Problem is newly entered record is not populated in GridView. If we refresh the page or reload the
page, new data is populated.
Can someone help me to solve this problem.
Thank you in advance
|
|
|
|
|
rema r wrote: Problem is newly entered record is not populated in GridView. If we refresh the page or reload the
page, new data is populated.
One way to handle this is that you really refresh the dataset from the database to reflect the current situtation in the database. Especially in multi-user environments it's typical.
However if the row inserted using a gridview goes to the dataset and from there it goes to the database and in that point it get's deleted from the gridview, I would guess that the gridview refreshes with old data. But without seeing the code it's hard to identify the problem.
|
|
|
|
|
Hi,
Thank you very much for your immediate reply.
Have attached code herewith for binding GridView from Ms Access DB
string strsql = "select BookId,BookName,Author,Editon from BookMaster";
OleDbDataAdapter adapter = new OleDbDataAdapter();
OleDbCommand command = new OleDbCommand(strsql, "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Testing\Library_db.mdb;");
adapter.SelectCommand = command;
DataSet ds = new DataSet();
adapter.Fill(ds, "roads");
GridView1.DataSource = ds;
GridView1.DataBind();
Thank you
|
|
|
|
|
Glad it helped.
|
|
|
|
|
Hi,
I am new to .net and may be this question is very basic..but I did not find much info on standard controls when I browsed.
I need to make a small application where the users would select a file for processing.
What controls can I use in .net so that the users get a windows explorer like file selector when they click on the button. The file they select should be passed as an argument to some other program.
Thanks
RS
|
|
|
|
|
You can use the FolderBrowserDialog or OpenFileDialog controls to provide dialogs that allow the user to select a folder/file.
Or you can build your own custom one using comboboxes, treeviews and listviews. You'll need to handle the various changed events and populate them all appropriately when the users clicks and changes things. (Tip: You can set the auto complete source on a combo box to "FileSystem" to give a kind of explorer style directory typer box.)
Probably easiest to just use the OpenFileDialog though.
Simon
|
|
|
|
|
Hi,
You didnot mention which version of .Net are you working on?
Anyways, if you are using .net 2.0 you can use fileupload control by which you can select the file same as you select in windows.
Just add below code on page_load event.
Button1.Attributes.Add("onclick","document.getElementById(' " + FileUpload1.ClientID+ "').click()");
Where button1 is the id of the button you want to open the browser window when being clicked and FileUpload1 is the id of the file upload control.
But if you are using .net 1.1 you need to write code explicitely for opening window explorer like file selector. There are some classes defined in framework for that.
Hope this will help.
Cheers
Shilpa
|
|
|
|
|
Nope, he can't. From the message context it seems he is developing a desktop app, and you are talking Asp.Net
Regards,
Lev
|
|
|
|
|
Hi... I have a problem and quite frankly I'm stumped
One of our clients is repeatedly getting the "Timeout expired. the timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached."
The common cause of this error is ofcourse the connection pool being exhausted, but this seems extremely unlikely - the connection keeps the default max pool count (of 100?), and the client has been unable to use this specific application since day 1. Secondly, the timeout on my connection is set to 120, but the client receives the dialog ~20 seconds after attempting to start the application.
The client is also able to start the application from another computer, using the same login (which should lead to the same connection string, and hence the same connection pool). The client is able to connect to the database using other (non .net) applications on his system. I have asked him to try and start other .net apps that connect to the database in a similar fashion as mine, unfortunately the client is Chinese, and not technically minded, which makes communication very hard.
Basically, I'm just looking for ideas for a line of investigation. Anyone have a clue?
|
|
|
|
|
I got the impression thet the application resides on the client machine and the connection pool also is located at the client. If so, does the client located application connect to the database directly? If it does, could it simply be that this client isn't able to connect to the database at all using the connection string in the application.
|
|
|
|
|
That does seem to be the case. Oddly enough with a different username he gets another error (Named Pipe Error 40), but it boils down to a connection not establishing. I'm going to try to get him to set his DSN to use TCP rather than Named Pipes, but this is basically clutching at straws.
|
|
|
|
|
In that case the pool may be exhausted since it's user specific. If after a reboot he gets the error with the original username, it may be that the connection can't be established (for example sql server isn't listening on named pipes) and if that error occurs several times the pool may be depleted. So you may have two partly different problems at the same time.
Since he gets a named pipes error it's good to start resolving that by changing the protocol. After it's worked out concentrate on the connection problem (if it exists anymore).
|
|
|
|
|
Just a swag, but since only one client machine is affected, could that machine have the wrong Jet db engine installed?
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
As a matter of interest, have you ensured that the connections have been disposed immediately after use? If you are acquiring connections for each database operations, it could be that the connection hasn't been closed and returned to the pool.
If you're using an enterprise database server, try monitoring the connections.
|
|
|
|
|
I did check the connections to the server with sp_who and by reading from sysprocesses, there are no connections open with his username when he is not actively using our system, and even when he is, there are 5 or less (with a max pool size of 100)
Is there a more efficient way of monitoring database connections?
|
|
|
|