Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Maybe try changing the following:

string sel = "DELETE FROM acomodation WHERE A_ID=" + A_ID;

to this instead:

string sel = "DELETE FROM acomodation WHERE A_ID='" + A_ID + "'";
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

>>when I create 2 datagridview with each using different bindingsource, and I click on next for the first datagridview, the other datagridview also automatically paginate to the next one.

Have you perhaps looked into the event handler(s) you are using?

It's possible that the two DGVs are somehow sharing the same event handling for the pagination in which case they would both fire off at the same time when using the navigation on either.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I know this thread is marked "solved" but I have to say that ardav's original concept does have some appeal to me some days :twisted:

That being said... after reading some of the posts I've read today I'm thinking a "Mark Post as Waste of Time" button would be more useful.

Yes, I know people can use (to some degree) the voting system to indicate the worth of a post and yes, I know you can ignore users... but for the life of me I can't get over how 'rude' it feels to 'ignore' a user (not sure why to be honest).

Ironically, while I feel bad about adding someone to an ignore list, I wouldn't have any issue whatsoever with publicly flagging their post as useless :twisted: Go figure.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Is it just me, or does nobody do any research prior to coming here and posting questions?

I mean, even without going to external sources (Google.com, msdn.microsoft.com, etc.) I'm able to pull together the following list of posts within DaniWeb alone that are related to sending mail from an ASP.Net app and perhaps have information that would solve the issue without having to create a new post that is not only poorly titled but lacking in any displayed effort whatsoever.

Additionally, if I actually GO to google.com I enter a simple search and receive numerous pages of information on how to do exactly what you're asking for.

Now don't get me wrong... I don't mean to sound like an ogre or anything... but seriously... you couldn't find any of these resources? Or was my initial assessment correct that you didn't even try to find the information before posting here and hoping someone would provide you with some code you could copy/paste directly into your project without doing any work?

And hey, if the above information isn't what you were looking for... perhaps providing a detailed question with a descriptive subject showing the steps you've tried and the issue you're facing might get you more specific help to the actual problem you're …

kvprajapati commented: Links!!!! +10
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Why resurrect a thread from 2004 just to tell us you're having problems with a web-based email service that has it's own dedicated technical support team? :twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I might recommend one of the following 2 resources to help you solve your issue (depending if you're running on a windows or a unix server)

  1. Resource #1 (Non-Windows Server)
  2. Resource #2 (Windows Server that supports ASP.Net)

Hope those help :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Unfortunately I wish to add the "selected items" ( listType.SelectedItem.Text ) to the body of the email...

Just because Rohand's specific example utilized the objEmail.To.Add() example doesn't mean that would be the only thing that would work in this scenario.

Simply replace the unneeded segment with the logic required to insert the specified text to the body of the email as needed and the foreach loop should do what you need.

As indicated, however, if the issue is actually solved, please mark it as solved (link next to the reply text area) so that others (like myself) don't think that more work still needs to be done on this thread :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

What I might try in this case is running the application in debug mode and trying to actually capture more specific information about the error from the debug/output consoles (assuming you're using an IDE for development).

A more specific error message might help both you and the community to figure out specifically what the cause is :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I might reference you to the 4 links I provided in this post that are all local DaniWeb posts related to transferring variables between forms in C#.

Hopefully one of them helps in your scenario :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

If you're working in ASP.Net that also means you're running in IIS... Which also means you can set up multiple application working directories and all applications running within their specified working directories would (in theory) run in their own app space.

Can't recall where I was reading about the processes for doing this but in theory it should be possible as long as you have access to work with your IIS settings to set up the application working paths correctly.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Should be a Discussion Topic instead of a Code Snippet... other than that tho, on my way out the door and hopefully someone else can help you out :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok... well....

Here's my theory (and no, I didn't make it all the way through your Stored Proc, sorry)...

  1. User 1 enters their input and submits
  2. User 1 receives confirmation of their input from the DB
  3. User 2 enters their input and submits
  4. User 2 receives confirmation of their input from the DB
  5. Both users receive correct information as, while they seem simultaneous in their entry they're actually still 'in order' based on the fractions of fractions of seconds it takes for the process to complete
  6. Entry 2 is assigned some sort of transaction key that is identical to Entry 1's transaction key due to a mis-code in the stored proc (stored proc may be giving both a transaction # of, say, 12) generally caused by the proc checking for existing key prior to processing and applying transaction key after processing, this can be avoided by having transaction keys auto-generated by the server instead of code
  7. Entry 1 is overwritten due to Entry 2 having identical transaction key

This is just my 'theory' on what's going on however. As I said, I've been kind of busy lately and haven't gotten through all of your code to confirm it.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

>>When two users run the page that opens the connection and executes the stored procedure...That page is ALWAYS correct.

Generally this can be attributed to the fact that you are utilizing 'local' variable sets on this page as opposed to the information present in the database. Each user gets their own 'session' on the server which contains all the local variables from their input and, unless you're drawing your results from the DB on the generation of the 'result' page you're presenting, all they're getting back is the information they submitted regurgitated in the 'formatted' view.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

And by "check out the msdn reference" you're referring to msdn.microsoft.com right Ryshad?

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

And hello back :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Welcome Rigved, hope you enjoy your stay at DaniWeb :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Welcome to DaniWeb, Iyad :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Welcome Sijmen, hope you enjoy your stay :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Nice intro :) nice to see when someone makes an effort instead of posting a one liner (or half liner) to the community intros forum. Welcome to DaniWeb.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Well, welcome to the forums :)

And if I might make a suggestion, make the change from Vista to 7 asap... 7 is (in my humble experience) the best of the bunch. Microsoft finally got something right with Win7. Only one thing I would watch for and that is in hardware compatibility. I found out the hard way that Windows 7 is not so friendly with older devices (like my poor HP LaserJet 1012 which works now, but very very slowly).

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster
  1. Geeks' Lounge is not the place to be asking your code/project related questions (last I checked)
  2. You're developing a project for what purpose?
  3. You're using MS SQL and VB.Net and it never occurred to you to allow the DataBase to do the id auto-generation for you as part of it's own ID column management?
  4. Geeks' Lounge is not the place to be asking your code/project related questions

Posting to try to be helpful as opposed to just neg-voting (which I came very close to doing) and hoping a MOD just pops this thread into the right place instead of deleting it for being in the completely wrong place.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

So, basically what I'm seeing here is "there's no row at position 0" which is translating to "your DataTable is not being populated or it would have a row at position 0".

Now, I'm seeing where you supplied variables for the results of each SELECT statement that was previously part of your stored proc... but I'm not seeing anywhere where you're returning those variables in any way to the user. This could be your issue :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Not that I'm adding much to this but I don't seem to have access to that post either with the same error as jonsca.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

>>How they can access to other computer, How virus made, etc.
Starting to sound pretty black-hat to me... Just sayin'

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I would start with a ruler and a calculator.

First, place the ruler along the bottom edge of the directory and measure it's width, then place it along the left edge and measure it's height. Multiply the two numbers and there you go :icon_twisted:

Alternately if you're just looking for the total size of the files within the directory...

A combination of file.GetFiles() and FileInfo.Length() might work for what you'd need. Using GetFiles to get a list of files within the directory itself and FileInfo.Length to get the size (in bytes) of each file and summing them up would get the total. You might need to do some recursive pathing if you want to include the sizes of all subdirectory content as well.

Hope that helps :) If it's not what you were looking for, perhaps a bit more detail on what specifically you needed would help someone come up with the best solution for you.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

msdn.microsoft.com indicates that the path needs to include: "The name of the file to be deleted. Wildcard characters are not supported."

Of course, if you'd read the link I posted instead of focusing all of your energy on typing ?'s into your posts you might have seen that :twisted:

Basically when using file.Delete() you must specify the absolute path to the file (unless the file is local to the working directory of your application) and the full filename of the file. If you are receiving no error message it is likely due to the fact that "the file does not exist" as indicated in my previous post (likely as a result of your not providing an extension for your filename).

If there are multiple possible file extensions for the file you are attempting to delete then perhaps you might want to look into a file.GetFiles() usage to determine the existance and full name of the file you are attempting to delete before attempting to delete it.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

The reason I believe the issue is the stored proc and not the code you originally provided is because all the code you provided shows is opening the connection, utilizing the stored proc to insert data and closing the connection.

If all it's doing is calling to the stored proc and nothing more then, logically, the stored proc is the source of the overwrite.

Maybe someone looking over the HUGE stored proc you provided above will be able to find the issue, or, maybe I was wrong... either way, it doesn't hurt to have as much info as possible to work with when attempting to find the source of an issue :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

What we would need to see (since what you're using is a stored procedure for your inserts) is the Stored Proc you're using.

The above code shows a call to the Stored Proc but nothing of the proc itself which makes it impossible for anyone to determine if there are errors in the proc that might result in row overwrites.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Generally you should be getting either a result of the file being deleted (assuming your directories are correct), an exception (in the event that your path is incorrect) or, in the event that the file does not exist, no exception is thrown.

Referenced from msdn.microsoft.com using Google.

Hope this helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Personal point of view when it comes to ASP.Net componentry is this:

  • If you are going to code part of it on the front-end, code all of it on the front-end
  • If you are going to code part of it on the back-end, code all of it on the back-end

Coding and databinding is handled in completely different ways when coded in front vs back end processes and they can often conflict or cause rather unique issues. Part of the problem comes from the fact that, while all code on the back-end is handled 'sequentially' (unless you get into multi-threading, which I don't) the code on the front-end is not necessarily going to execute 'in synch' with what's going on in the back end. This can result in calls to information on the back end that are related to information not yet generated on the front end (or vice-versa). As a result, it's usually best to keep all related code in the same place as opposed to mixing the two.

Now, to clarify, I'm not saying "code your entire application" on the front or back end, but if a specific component is being generated in one or the other then the related code for manipulation of that component should all be in the same place. The only exception in this case would be code that handles events driven AFTER the page has been fully loaded (event handles, button clicks, etc) as by the point where they …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Welcome to DaniWeb, Roni.

Nice to see someone who had more patience than me with regards to sticking it out with linux :twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Well, for starters, welcome to DaniWeb.

However, the Community Introductions forum probably won't net you many answers to your problem so I might recommend that you check out the Software Development or Web Development forums and put your question in the section that relates to the language(s) you are using for development :)

Also, before you do that, I might suggest (as all new members should do) that you read through the site rules quickly to make sure you're following them :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Msg 2715, Level 16, State 7, Line 1
Column, parameter, or variable #1: Cannot find data type date.

Also, when I use the table designer the only date related types are DateTime and SmallDateTime.

That, right there, is why I was recommending DateTime :twisted: MS SQL 2005 is very... uncooperative... when it comes to date/time formats.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Check here for a list of data types supported by transact-SQL in SQL Server 2005.

date is supported but I always use dateTime myself *shrug* maybe that link'll help sort your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

As I said... try DateTime as your dataType :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

If anything you'd be needing a "DateTime" format as opposed to "date".

Without seeing specific code segments though I wouldn't be able to answer more directly to your issue.

Annnnd.... post # 666 for Lusiphur :icon_twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

While it's not using C# (the thread in question is in the C++ forum) it might give some idea on the methodology you might use for what you're trying to accomplish.

This thread is related to being able to lock a target machine on a network and terminate all applications running on it. So, while your project involves simply determining whether the remote machine is locked or not, I figured the similarity was enough that it might help.

Hope it helps somewhat :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

As it seems to come up often enough I figured I'd throw together a quick snippet outlining basic methods for data manipulation in SQL Server using C#.

In all examples the coder will need to substitute their own connection string details and variables.

I utilised parameters for 3 of the examples but they can just as easily be replaced by direct references to dynamic controls in your application if desired. The benefit of parameters, however, is that they set the 'type' of the variable being passed and add an additional level of type checking to the app.

I'm hoping I didn't bugger any of the code samples when throwing them together.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

If I understand your question correctly (you didn't give a lot to work with) you're looking for something like this:

SqlDataAdapter da = new SqlDataAdapter ("SELECT * FROM Table WHERE column='@varNameHere'",con);
da.SelectCommand.Parameters.AddWithValue(textBox1.Text);

Essentially, you'd need to modify the correct command type within the adapter with the parameter you wanted to add... I am not 100% sure because I haven't tried to manually override the default adapter methods recently but you may also need to actually set your SELECT statement with the use of the following instead of in the actual adapter declaration in order for the SelectCommand methods to work as well:

da.SelectCommand.CommandText = "SELECT * FROM Table WHERE column='@varNameHere'"

Hope this helps (and hope I'm not butchering it at the same time) :)

EDIT: As I thought (and as saravind pointed out before I could finish typing my reply) you do need to set the CommandText separately instead of in the declaration of the adapter when using parameters :)

AngelicOne commented: cleared me up! thanks +1
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok, I must've been more tired than I thought last night 'cus I didn't remember having 'solved' this thread and was about to do it today only to see it was already done :twisted:

Ah the joys of late-night insomniac curiosities...

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Personally, no, I can't do that for you.

If you have your own domain, you should very easily be able to set the mail options within that domain to forward your mail to a list of alternate addresses if you choose and if you're not sure how I'm sure your hosting provider or registrar would be able to help.

If, on the other hand, you're trying to have mail forwarded from an account you don't have access to, to an account you do have access to, best of luck.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ya, um... after digging through the page source at the URL you provided I'm going to guess it's something easily solved by setting padding to 0 on either the DIV or the table within the DIV for your top 2 DIVs on your website.

But then again I could be wrong because I got tired of reading through the page source about 1/2 way into the 2nd DIV.

Perhaps if you were to post the CSS and HTML details of the page in question here in the forum someone else who might otherwise not have looked into it (as some folks just don't feel like going to an outside site and manually opening your page source to find the issue for you) would be able to find more of the issues for you.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Please mark this thread as solved :)

Hahaha :twisted: well... technically ya, it's kinda solved since the answer was very plainly given 'with authority'

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Hey AD, grats on 18k witty retorts... I mean posts... either way grats :twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Just go to the thread ~s.o.s~ gave you and add this...to the reputation comments :D

Ya, Except that I'd already -1'd that one too but without comment (because the comment was on the other one and it doesn't let you double-tap on rep votes).

S'all good though LoL I'm just thankfull to ~s.o.s~ for goin' out of his way and finding my answer for me last night :twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Agree with both of you but unless GAME wants to be more specific I guess we'll never know what he's looking to do anyway :P

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Oh wait, I guess I remember that thread. Wasn't it the one having the contents same as this thread for which you had given a neg rep? It was deleted since it was a dupe, which kinda explains why you couldn't find it. :-)

THAT'S THE ONE!!! Darn... you had to delete the one that had the witty neg comment attached to it didn't you? (or whoever did delete the dupe) :twisted:

EDIT: As a side note, hope people aren't getting the opinion that I enjoy giving negs or am some kind of elitist from this conversation hehe. 99% of the time I never vote on threads... If I feel a thread deserves to be voted (up or down) I usually just vote the post... It's only when a post is REALLY good or REALLY aweful (in my opinion) that it gets an actual rep vote too.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Perhaps next time, subscribe to the thread? ;)

Only problem with that is this... I try to keep my subscriptions trimmed down to a minimum and... the thread was (as I noted before) horrendous which was why I voted the thread and the poster down in the first place :P

I try to keep my sub count below 20 and only to threads I've started or threads I'm actively following at the current time. I generally purge threads from my sub list if they have no activity in their posts for more than 3 days.

What was that thread about? Thread moving / deletion as duplicate is quite frequent around these parts so unless you can remember the contents of the thread or its context, not much can be done. :-)

The thread was one of those ones that the content was un-memorable other than the fact that it was written nearly entirely in txtSpk :twisted:

Oh well, really not that important in the big picture just something I was curious about. I don't always reply to threads that I vote on so I just thought it'd be nice to be able to pull up a list of threads I'd voted on was all.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

It's a shame though... I really was kind of interested to know what became of a thread I down-bumped yesterday and I can't find it ANYWHERE now (at least not in any of the forums I frequent and I really don't think I was crossing into other forums recently).

Oh well :)

My theory stands that it was likely nerfed by a moderator (it was that horrendously written) but I'll never know for sure.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I know I can see any reputation I've received by looking in my profile and such but I'm kind of curious if there's any way to see reputation I've given?

It may seem wierd but I kinda wanted to check up on a thread that I down-voted (and gave rep on as well) and can't find the darned thing (either someone else up-voted it and it no longer shows the -1 or it got deleted or I'm just looking in the wrong forums).

Just a little quirk of mine that I like to check up on stuff here and there in a 'follow-up to see if anything came of it' kind of capacity :twisted: