I would use:
using System.IO;
Coupled with a bit of research into how that works you should be set :twisted:
I would use:
using System.IO;
Coupled with a bit of research into how that works you should be set :twisted:
kibr987, please remember to mark threads solved once your issue has been resolved :) that way people don't see an unsolved thread and think it still needs to be looked into.
Already tried that before but no good.
Did you even try my suggestion? :twisted: after 2-3 days of trying to clear and rebuild 1 dgv you'd have been able to stack 10 of them with my suggestion by now :P
i have not used absolute/relative as when i did that also messed things up eg, some divs would be in the right hand side of the design in dreamweaver but centred in a browser.
I think you misunderstood ardav in relation to absolute/relative.
From what I'm reading he was talking about your URLs within the pages and asking whether the URLs were absolute (http://yourdomain.com/page.aspx) or relative (/page.aspx) as absolute URLs sometimes auto-generated by dreamweaver and other design apps can sometimes point to a local directory in your system if the URLs were generated prior to the file being saved as part of your site/project.
This could also have applied to the location of your CSS file pointer (using either method I mentioned before) causing it to find the file locally when you test on your development computer but not find the file once uploaded to a web-server.
Hope that helps :)
As much as I'd love to do that (and I did try to look it up for anyone who's wondering) I'm not entirely sure how to go about it.
It actually seems possibly related to http://msdn.microsoft.com/en-us/library/ms972429.aspx and I bring that into the equation only because an error that I have come across once or twice has occurred if I left my journal page open while I went over here to DaniWeb to answer a question or two and go back I get a session error (which is solved by reloading the page but still).
I somewhat wonder if the two are inter-related.
I would use something like the following (I just woke up, I threw it together on the fly, so test it before you rely on it in your finished product):
private void showAlert(bool trueFalse)
{
string alertMsg = "";
if (trueFalse == true)
{
alertMsg = "Database update successful";
}
else
{
alertMsg = "Database update failed";
}
ClientScript.RegisterStartupScript(GetType(), "dbAlert", "alert(\'" + alertMsg + "\');", true);
}
Couple that with having a bool variable determined by the return value of your SQL insert/update (if you're using ExecuteNonQuery you'll get an int value indicating number of lines affected, you can determine from the result whether success was true or false and pass the bool to the procedure I wrote).
Hope that helps :) Please remember to mark solved once your issue is resolved.
Yes, if you want to use the existing DB as a flat-file db within your application you can follow hirenpatel's instructions there, just be sure to adjust your data sources and bindings to match the new db location instead of the old or you're in for a world of debugging hurt :twisted:
I could be missing something, or the fact that it's 2:45am and I'm about ready to pop off to bed could be influencing the clarity of my thinking.
That being said, I'm also not an "expert" so much as I'm good at finding the answers I need as I need them while I'm coding :twisted:
I say all this so you can take my next bit in context as having a 50/50 chance of being a total crock 'o sh*t hehe
Personally, I'm used to the <form> tags encompassing all of the interactive (read: asp.net) components within my pages. I'm also used to every <form> tag that's related to ASP.Net components having an id. When I look at your code it looks like you have a login content segment which has an enclosed form segment but that you also have a separate contentplaceholder segment which I will assume relates to your earlier code segment where there are form elements that are not in any way encapsulated within a form element.
Beyond that bit of speculation, I can't help you but maybe I'll have more luck in the morning if you're still having issues then :)
The .mdf file is the extension of the deattached database?
Yes, it is :) Again, read my previous post regarding the pros and cons of using a localized flat db vs a centralized db depending on intended user distribution.
To expand on this a bit your two options are:
The way you have it now, because you developed it off a db on your local machine, it's only set up to connect to that DB and only if the program is installed/run from that machine.
Something else to consider, if it's using computername\\SQLEXPRESS as it's connection, odds are it's also using windows authentication and so, if you host it off a centralized DB server, you will likely want to ensure it's using either un/pw style authentication or that you know how to set up accounts and permissions for individual login rights (easiest and common is to use the sa account to log into the DB unless you have groups setup within the db to accomodate different read/write/access rules for different categories of users which is likely far more advanced than your project requires). If you do set your connection string to include un/pw login you'll want to make sure that the connection string details are secure . Generally I bury it within a separate class and call it like so:
blConn loadConn = new blConn();
string connStr = @loadConn.cString;
Where blConn is a class containing …
Well... I see that jbennet replied in the same day :)
And I wasn't here then, sooo... welcome :twisted:
I'm actually confused because the code snippet you've provided doesn't appear to have anything 'out of the ordinary' to it that I can see from first glance. Coupled with the fact that you have NO form tag that I can see, I'm not sure why you'd be getting the error that you can only have 1 form tag.
The last time I got the error "A page can have only one server-side Form tag." it was because I had a braindead moment and forgot how to separate content with panels and tried to do it with forms :twisted:
That being said... having 0 form tags may cause issues with trying to run ASP.Net server side scripting ;)
This would mean that the loop would be broken each frame and then not executed once the boolean value is true. The loop would only ever need one iteration every time before it is broken.
Is there no other way?
Heck, I was just tossing theories at that point, I'm not super knowledgeable on node navigation :twisted:
Code looks fine, I think this may be a timeout issue.
See that's what I'm thinking because the code excecutes flawlessly every attempt I make at replicating the error, and only certain people seem to be getting errors.
Any thoughts on what would be causing a timeout issue however? Or would I be safe in my initial assumption that it may be related to my host and the fact that I get to share bandwidth/resources/etc with everyone else on the same shared hosting node as me?
Good day folks...
This may seem like an odd question and I apologize in advance for the limited information to work with in this case but I'll do what I can to give the needed info...
My website http://www.bariby-quance.com has a journal/blog component that I built within it that, on all of the computers in my household and in 3 different browsers (Firefox, IE and Safari) has never once encountered an error.
However, I have had a couple of people tell me they are receiving errors when using the asp.net apps I've built into my site and I can't replicate them. I spoke with technical support at my hosting provider but they don't have server-side error logs they can provide me on their windows server platform. The tech support agent did, however, hit an error after literally hundreds of clicks on the post navigation buttons in my journal as follows:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Unfortunately, not having had debug mode active on the page at the time I wasn't able to get more details on the error cause (and as I said I haven't been able to replicate it).
The navigation buttons on my page are simple and the code is as follows:
protected void newestButton_Click(object sender, EventArgs e)
{
Response.Redirect("blogged.aspx?post=" + highestPost.ToString());
}
protected void oldestButton_Click(object sender, EventArgs e)
{
Response.Redirect("blogged.aspx?post=" + lowestPost.ToString());
}
protected void fwdButton_Click(object …
Care to share the actual error? It may provide a clue as to what caused it :)
As like AS2, In AS3 we didn't have the duplicateMovieClip, Instead you just create the movieclip instance with the Linkage Identifier in the library and add it on the stage number of times you want with proper positionings. You drop on a particular movieclip you can make a "HIT test" on the clip.
Thanks for that, I think I already read up a bit on the hit test methods so I guess I'll have to look more into creating additional clips and disposing of them as they're no longer needed for what I want to do.
ZOMG, Dani came out of the community forums!!
And yea, I can definitely say that the level of customization that is visibly apparent in DaniWeb looks like it took a LOT of time and debugging to put into play. DaniWeb is to vBulletin as the WWW is to a small home network :twisted:
Panda3D is an free 3D engine that allows Python programming as well as C++. So you win with this engine either way.
Good to know :) But at this point I'm more trying to figure out which direction to invest my energies into between C++ and Python more than I'm trying to find out what tools support which language.
I don't want to, for example, spend the next few months pouring over resources and texts and creating test-projects on my own time to learn Python if 80% of the market is looking for someone versed in C++ :twisted:
But I will keep your information in mind once I get to that stage where I'm looking for supplimental tools to work with in whichever language I end up going with.
I'll preface this by saying that, while I know a fair bit about C#, ASP.Net, HTML, etc... I am a mere pre-novice when it comes to AS3 scripting for Flash.
The basic idea of what I'm trying to do here is to create a simple children's mathematics game which runs through various mathematics excercises and uses coloured number tiles to 'fill-the-blanks'.
I've already figured out how to allow the user to pick up and move the tiles, how to ensure that the tiles can only be dropped on pre-determined targets and return them to their starting position if they aren't and how to allow a user to pick a tile up off the targets to drop them back where they started as well.
What I'm curious about is how to create a 'duplicate' of the number tile once it's been placed on a target where the duplicate appears in the original starting position of the chosen tile and has identical (enough) properties to the original that I can use it in the same way as the original (say the answer to a question is 11, they need to be able to select 2x "1" tiles).
I'm also curious as to what type of event I can use to 'register' that when the "1" tile is placed on a target square the value of "1" should be stored in a variable.
What I have so far is this:
var startX:Number;
var startY:Number;
var tile_Y:Number = …
Personally I'd like to see some more basic tutorials for beginners such as:
I only mention those examples as they're related to a project I'm working on as a complete newbie to flash programming but I'm sure there are many more "newbie how-to" topics that could be covered.
I just wish there were more Flash tutorials out there. As it is now, it's difficult to find the resources to do some of what I'd like to do without knowing in advance exactly what functions/methods to use which would eliminate me needing to be looking for them in the first place.
From what I'm seeing it was a matter of how the float properties were (or weren't) defined as these determine the relative position of the component to it's neighbors.
Please also remember to mark threads solved once the issue is resolved :)
Have you considered calling the JavaScript alert function once confirmation of the data insert has been received?
Something like this example here but modified as you need it for your purposes.
Hope this helps :) Please remember to mark solved once your issue is resolved.
Yes, it's one table... but... it's DIFFERENT information being selected and DIFFERENT columns/content being displayed to the user.
Which is why I'm saying that since it's effectively 2 separate subsets of data, maybe you should use 2 separate dgv's :)
Ok, I misread what your intent was here...
dataGridView1.Columns.Remove("columnName");
Will remove any columns that are you don't want in place.
dataGridView1.Columns.Add("newColumnName");
Will add new columns with chosen names. From there it's a matter of ensuring that the new column names match to the data you're using with your new databinding.
Beyond that, my oncoming headache is putting me out of commission for a few hours so I wish you luck.
Alternately, you COULD just use 2 different dgvs if you're using separate data sources and have the appropriate dgv visible while the other is invisible (using the visible property) depending on which dgv you need to present to the user. For win-forms apps you just place the one over top of the other to make it "appear" as if it's the same view in the same place but that way you don't have to muck around with adding and removing columns on-the-fly.
Ok, well... clearing the rows on the dataGridView isn't going to help you if you don't re-populate the dgv with new content afterward. But your question was how to clear the dgv and that's where dataGridView1.Rows.Clear() comes in :)
I'm throwing a bunch of assumptions into my theory here and without physically setting up a GridView that matches yours detail by detail I didn't get to test it but... This might work (and it wouldn't hurt to try unless someone else gives a better solution)
for (int a = 0; a < GridView1.Rows.Count; a++)
{
if (GridView1.Rows[a].Cells[6].Text == "0")
{
GridView1.Rows[a].Cells[7].Text = "Class Full";
}
}
Where Cells[6] should represent your remaining spots cell position if I counted right (starting at 0) and Cells[7] should represent your hyperlink cell position.
I hope it works :) If not, I hope someone else can be more helpful. Don't forget to mark solved once your issue has been resolved.
You might be having a similar issue as described in this link.
Reply # 2 on that link outlines how to resolve that issue if that's the case.
It seems in the case of the link above the absolute path was so long (due to subdirectories and such) that it exceeded the maximum number of chars for the file path.
Hope this helps :) Please remember to mark as solved if your issue is resolved.
Dude... you're killing me here :twisted:
Try:
datagridview.Rows.Clear();
Basically, keep it simple...
SqlCommand cmd = new SqlCommand("select * from student where student_no='" + numericupdown1.value.ToString() + "'",con)
and
numericUpDown1.Value = Convert.ToDecimal(dt.Rows[0].Columns["Bookshelf"]);
When performing SELECT from DB convert your decimal value to string. When pulling from DB to your control convert from whatever type you're pulling from the DB (you said INT) to decimal.
Perhaps if you were to include some of the code that you have used (specifically the code implementing the Silverlight player in the first place and any code attempts you've made at manipulating the source via the code-behind) someone might be able to dig through the code and find the problem or suggest a solution :)
File.OpenRead is basically 2 components in 1, File represents a call to System.IO.File() where OpenRead is the method used within System.IO.File to determine the file handling process, in this case, allow opening and reading of the file but not writing.
fs.Read is basically calling your fileStream that you created and telling it to use the Read method with the use of the file variable determined above it.
Hope this helps :) Please remember to mark solved if your issue is resolved.
This might help... obtained through this exceptionally difficult process :twisted:
Hope it helps :) Please remember to mark solved when your issue has been resolved.
In Dreamwever specifically you get 2 options in regards to attaching your style sheet... I find, however, that only one of them works reliably. The two options are
<link href="test.css" rel="stylesheet" type="text/css" />
And...
<style type="text/css">
<!--
@import url("test.css");
-->
</style>
Between these two I almost exclusively use the import method as the link method has a habit of not registering on some (read: many) browsers.
Hope this helps :) Please mark as solved if your issue is resolved.
1minute difference. :D
Thanks!
Ya, you snuck in there while I was typing :twisted: Hope it helped though.
And I can immediately see why.
Let's try this again :)
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM Users", con);
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
dataGridView1.DataSource = ds.Tables[0];
}
You need to do the condition check AFTER the dataSet is populated but BEFORE the dataGridView is populated.
The only concern here is, in the event that there is no information in the dataSet, the dataGridView is not populated at all so you may need to find some way to address that as it means that without a dataSource the dataGridView will also be unable to add to your table.
numericUpDown1.Value is ALWAYS of type decimal ,so an integer like 42 is auto converted, a double like 42.0 is not, in that case you can use the M suffix (42.0M), for strings use conversion methods.
<-- What he said! :twisted:
Which is why you do your conditional read based on the number of rows present in the dataset, if no rows exist in the dataset then it will not attempt population. If, on the other hand you set your condition based on a dataTable then it's trying to move information from an empty dataset to a dataTable and generates an error.
It's probably returning the value as INT, but your numericUpDown1.Value is reading as decimal. Thus you need to convert the returned value (which is INT) to decimal before putting it into numericUpDown1.Value.
However, when using the value as part of a SQL query, you're converting it to string because you're using a query "string" to select values.
On a different note, I generally avoid using DataTable myself... I'd rather iterate through DataSet and DataRow.
For example:
SqlDataAdapter da = new SqlDataAdapter("SELECT MAX(Transaction_No) AS Transaction_No FROM Transactions", con);
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)//checks to see that the number of populated rows in table 0 are greater than 0
{
DataRow dr = ds.Tables[0].Rows[0];//sets datarow "dr" as row 0 of table 0 of the dataset
textBox1.Text = (Convert.ToInt32(dr["Transaction_No"]) + 1).ToString();
}
Ok, quick question here...
Are we talking about attempts to read a table that has 0 rows or are we talking about reading from a table where there may be an empty row returned as part of the query?
Well again, what is the data type for numericUpDown1.Value?
Another thing I'm seeing here (and your way might work but I prefer to do it this way):
numericUpDown1.Value = dt.Rows[0].Columns["Bookshelf"].ToString();
However, if numericUpDown1.Value has datatype decimal then converting dt.Rows[0].Columns["Bookshelf"] to a string value and trying to pass it to a decimal container will fail.
My assumption will be that when it's pulled from the DB it's going to be presented as a decimal value anyway in which case you can drop the .ToString() from this part (keeping it in the SELECT statement) and if absolutely required can add a Convert.ToDecimal(dt.Rows[0].Columns["Bookshelf"]) to ensure it's registering as a decimal prior to trying to apply it to the numericUpDown1.Value variable.
Worst case scenario (ie: my brain hasn't tuned up yet for the day) use:
numericUpDown1.Value = Convert.ToDecimal(dt.Rows[0].Columns["Bookshelf"].ToString());
The error message you are getting actually kind-of tells you specifically what's wrong there... "non-invocable member 'sytem.net.mailmessage.to' cannot be used like a method" means that:
Message.To(0).ToString;
cannot be used in that way. The "To" component of Message cannot accept variables directly.
Were you perhaps going for
string sToAddress = "";
sToAddress = Message.To[0].ToString();
with special attention on the square brackets instead of rounded brackets.
Keep in mind, I haven't tested this snippet, but I made a couple of educated guesses based on what you had provided.
Hope this helps :) Please remember to mark as solved once the issue has been resolved.
To be more specific here to your other post regarding incorrect data type. Essentially, I'm not sure the specific value of numericupdown1.Value (if it's integer or bool, or double) but you could save yourself a lot of issue if you changed your SELECT statement as such:
SqlCommand cmd = new SqlCommand("select * from student where student_no='" + numericupdown1.value.ToString() + "'",con)
Hope that helps :)
AngelicOne Generally when it tells you that you cannot implicitly convert a variable to another type there's a simple solution :)
What cannot convert implicitly must be converted explicitly. What this means is... Rather than use something like
string varString1 = someInteger;
Which would be an implicit cast from integer to string you would use:
//Option 1
string varString1 = someInteger.ToString();
//Option 2
string varString1 = Convert.ToString(someInteger);
The first method works great for strings because virtually every data type has a .ToString() method. Many of the other possible conversions, however, do require the 2nd option :)
I'm not specifically seeing the variable conversion that's causing your issue based on the source code you provided so I can't give a specific example to match the error (I could just be missing it) but I hope this helps :)
No. When only the start is given substring returns all the text from given start index to end of string. A bit link the old VB right$:D
Dude!!! Do you have any idea how much time that little tidbit of information would have saved me in a couple of past projects of mine? lol
Excellent, at least that gives people a place to start.
So ideally what you'd be looking for in this case would be a method using VB (read: ASP.Net as that can be either VB or C#) or javascript or a combination of both which allows you to connect to an Access database and inserts/updates information based on user input on the site's form.
Me, I'm a C# person, not very strong in VB but...
This reference might help put you in the right direction, as might this reference.
Hope these help :) Please remember to mark as solved once your issue has been resolved.
Another way using the button Name (as Lusiphur did) would be:
Button btn = (Button)sender; textBox1.Text = btn.Name.Substring(6);
Borrowing Lusiphur's closing line;)
Hope this helps and please remember to mark solved if your issue is resolved.
Hehe ya, I was tossed up whether to use the regex method (assuming that all buttons contained the string "button" and removing that from the name to get the number) or to use the substring method (assuming all buttons contained the string button so starting at the end of the string and running to the end to get the number).
My only thought here is, doesn't .SubString() require the starting point and the length of the substring? in which case you need to do a bit more math to determine the length from the end of the word button to the end of the name and include that as a 2nd variable (ie: btn.Name.Substring(6,2) for a 2 digit button number).
Great example though :)
Thank you so very much heloptra :) I'll look more into some of your suggestions.
I was kinda hoping for more than one opinion when I started this thread though, I guess nobody else in DaniWeb is involved in game design at all? :P
Listview1.Datasource=ds
ds must be your datasouce or datatable
Interesting because when I pop open my trusty visual C# in VS and create a listView... it doesn't have a Datasource property.
Which, was also indicated in the link that pritesh supplied :) By the way, good link pritesh, perhaps a bit confusing for a beginner but the theory is all there.
Edit: Now THAT link, hirenpatel, is definitely going to do the trick as well :twisted: