|
|
Hi Guys,
i have a website that allow my client to login and apply for staff so upon sending the application i recieve an email that tells me a user has add something..
so i want to use a link from an email to auto login to my site and access the page that m willing to access. i use the following to send the email
XmlDocument xml = new XmlDocument();
xml.Load(HttpContext.Current.Server.MapPath("../Templates/NewCorrespondent.xml"));
string emailXML = string.Format(xml.OuterXml,aprov.CompanyName,aprov.CompanyType,aprov.VatRegistered,aprov.vatRegistration,url());
string emailBody = WebUtilities.Transform(emailXML, HttpContext.Current.Server.MapPath("../Transforms/NewCorrespondent.xslt"));
string table = (CompanyDetails(USRID) + "" + emailBody);
messaging.sendEmail(SupportEmail(), "New Correspondent Has Been Created", table);
|
|
|
|
|
Do you have a question or are you just sharing code.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
No. It's a description of the application.
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
As English may not be your primary language I'll give you a hint. Questions contain statements such as, How can I do X, or, I would like to be be able to... and are followed by a question mark (?)
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
If the user is logged in, a cooky would be set. If the browser opens and the cooky is valid, there wouldn't be a need to login. Hence, clicking the link would open it, as if the user is logged in.
Providing a link with an embedded password would be less secure.
Bastard Programmer from Hell
|
|
|
|
|
Thank guys it worked just fine, my problem was in the xslt...
|
|
|
|
|
Hello Everybody,
Can anyone help me for developing algorithm for Sewer colony optimization?
The concept of Sever Colony Optimization is different with Ant Colony Optimization. and It is different with Finding Shortest path Network.
Thanks
If you can think then I Can.
|
|
|
|
|
As this is an algorithm question, you should post this in the algorithms forum.
|
|
|
|
|
Yes, but it'll cost you $31.50[^].
/ravi
|
|
|
|
|
Nice find, Ravi!
Will Rogers never met me.
|
|
|
|
|
Hi, i've some method which reads from text file. and returns string[]
i would like to read at the same time from 5 different files (big files...)
so i'll create 5 threads, and pass some string [] wrapped in object, then i'll run those 5 threads, and in the end i'll return some object which contains the data from file which i read...
it works but seems to be a bit "inefficient"...
any different idea will be appreciated
|
|
|
|
|
When the files are on the same physical disk, attempting to read more than one file at a time is usually slower than the same amount of work done sequentially. The reason being that the disk heads are forced to move back and forth between the files, i.e. spending time preparing to read data, not actually doing it.
Alan.
|
|
|
|
|
ok, then i''l use backgroundworker and read files sequential...
but then i need to parse the buffer (lets say string[])which i just read.
and then i'll do it by using threads, but the question is if there more "professional" way to achieve my goal, rather than the one i've described earlier ?
thanks
|
|
|
|
|
TPL is more "professional" then backgroundworker IMHO lol... well, its newer and easier to code / structure vs. BackgroundWorker.
|
|
|
|
|
True if the files are actually on disk, not so if they are in a memory cache, or on different drives or (probably) on a solid state disk (USB stick etc).
|
|
|
|
|
I prefer to store data read from files in a database table, then other applications can read from there.
But that's just me.
|
|
|
|
|
it's not my choice where to put the data...
|
|
|
|
|
As Alan has already mentioned, reading files from the same physical disk is usually slower. And to add to that, you may try reading data in chunks rather than reading the entire file at one go. It may not increase the "efficiency", but it may add to the responsiveness of your app.
|
|
|
|
|
Hi,
I am working on the C#/.NET application where in i need to get Current Identity value of the table using LINQ. Or else I can use the sql query to get the task done by either using
var num = DataContext.ExecuteCommand("Select IDENT_CURRENT ('table')");
By using this above code, i am getting the value = -1.
or
var num = DataContext.ExecuteQuery(("Select IDENT_CURRENT ('table')");
By using the above code, i am getting an exception "Specified cast is not valid." and the value remains NULL.
Correct me if i am doing something wrong. let me know if there are any better ways to do this task.
Thanks for ur help in advance.
|
|
|
|
|
First, you can't do it in LINQ.
Next, the bigger question is why are you getting the next IDENTITY value or a table?? What do you think you're going to do with that value?? This value isn't usable in a multi-user environment because it can change immediately after a client gets the value.
Whoops...I missed the DataContext part. You're supplying a single parameter when ExecuteQuery expects two of them at least. The first is the query (you've got that), the second is the type of the IEnumerable to return. In your case, that would probably be an Integer or Long?
|
|
|
|
|
Thanks for the reply.......
I will using the Current Identity value of the table in creation of folder with name as Current Identity value. is there a way to do this different it is not to be done in LINQ?
|
|
|
|
|
madhubabu wrote: is there a way to do this different it is not to be done in LINQ?
When he said you can't do it with LINQ, he meant with LINQ syntax (e.g., "FROM blah In context.SomeTable SELECT field" is LINQ). You should have no problem doing it with ExecuteQuery if you follow his advice and specify the return type (and follow my advice in the other thread and get the first item from the returned collection).
Driven to the ARMs by x86.
|
|
|
|
|
I am new to .net so my request may look silly.but here is my question...........
can i know what would be the return type and even how to extract the first value out of the collection for
var num = db.ExecuteQuery<"ReturnType">("Select Ident_current('[mers_testing].[dbo].[Repositories] as value')");
The Identity column in the database is of datatype smallint
Thanks in advance
|
|
|
|