Have you tried checking here?
Hope that helps :) Please remember to mark solved once your issue is resolved.
Have you tried checking here?
Hope that helps :) Please remember to mark solved once your issue is resolved.
You could set a default URL string value on the page generated as the first value obtained at the time of the dropdown's population. Then set the dropdown selected item changed event handler to change that string value and use the string as your URL to load instead of using the selected item property as the URL.
Basically...
string linkURL = dropDownDataPopulationFirstValue
dropDownName_SelectedIndexChanged Event
linkURL = dropDownName.SelectedIndex.Value.ToString()
ClickableLink = linkURL
No, that's not actual code, just the outline of how to do it.
Hope that helps :) Please remember to mark solved once the issue is resolved.
My thought is, if it's at all server-side related it'd be the speed at which the information is being presented to the user. I don't believe that your javascript link system is an issue per-se but more the size of PDF files and speed of file transfer. However, this can be either a server issue or a client issue or neither (in the case of router issues BETWEEN server and client).
As I indicated, I had no issues whatsoever with a random cross-section of links that I opened from the site so it leads me to infer that the issue is either client-side (reader issue/reader version) or server-side (beyond the script, actual server file presentation).
I take it back... after fiddling and playing with the controls I can't get it to do what you want :twisted: The main reason being that the databinding is not controlled enough for me to get a variable into the 2nd repeater representing the message id of the first repeater so it can selectively populate a list of responses related to that item.
Sorry, really thought it would work and if you can find a way to populate the repeaters at the code-behind level instead of the front end data-bind level it would work :)
Technically, if configured correctly with the 2nd repeater INSIDE the first repeater (which I guess is the tricky part) and the correct data population you should be able to get the effect you're needing with what I supplied.
Basically repeater1 should be configured as a straight up select of all the "questions", repeater2 should be configured to select all answers based on the current question. In that way it SHOULD give your required result.
By configuring as indicated abouve you should get the following:
Repeater1 details
Repeater2 details
Repeater1 details2
Repeater2 details2
Repeater2 details2, 2nd
Repeater2 details2, 3rd
Repeater1 details3
Repeater2 details3
And so on... I'd play around with dynamic population of the dataset for repeater2 based on the current information from repeater1 to achieve this result.
Not sure what you mean there... Your initial question was how to check for a change in the file. In order to do that you need to have the original file vs the file being checked. Only other way that would be quicker and easier is if you had a stored table of checksum values for your files and compared against that.
What I might recommend is a dynamically populated set of repeater objects instead of a datagrid.
Basically you set the "fields" of your repeater (labels, text areas, whichever) along with styles and colours of choice and you populate the repeater from your data.
In that way you can have 2x repeaters, one for the primary discussion/original post and one for replies which is a subset of the first one.
When populating the first repeater it populates based on the primary discussion and if the primary discussion has replies you populate the secondary repeater with those.
Unfortunately, it's a bit beyond what I've done with repeaters myself so I can't give detailed code as I've only worked on single-level repeaters myself but I'm sure it can be done :twisted: and it would allow you much more flexibility on formatting and such than the datagrid method.
A good resource for how to use the repeater can be found here.
Hope this helps :)
Edit: I would approach it something like this:
<asp:Repeater ID="Repeater1" runat="server">
--Repeater format setup--
<asp:Repeater ID="repeater2" runat="server">
--Repeater format setup--
</asp:Repeater>
</asp:Repeater>
You could, yes, but the principle remains the same... you need a benchmark file to compare to item by item in order to determine if a change has occurred.
<-- Using firefox and having no difficulties whatsoever with the links on the page presented :twisted: 9/10 times issues viewing pdf files boil down to reader version issues or site delivery issues moreso than browser specific issues.
As a side note, I refuse to use Internet Explorer for anything other than testing web content as I'm developing.
So to expand on the above example, to shrink by 2/3 but keep same container/display dimensions...
Completed new rect would be (129, 204, 46, 21).
Well my method works best with a consistant overall ratio change (ie: you double the display size therefor ratio = 2:1 or shrink to 2/3 size giving ratio of 2:3)
With an example of 2:1 (doubling) I would do the following
Hope that helps somewhat. In the end you end up with your original rectangle at (150, 200, 25, 25) your 2:1 rectangle (based on doubling display size as well which displaces the center mark to a new position in the process) at (300, 400, 50, 50). While it may seem the matter is as simple as doubling all the numbers the basic formula can be used to replicate the ratio change as well as insuring visual symetry in the center point of the shape.
In situations where you want to zoom the shape but not the container/display you can use all the steps above but omit the ratio …
For starters you would need to have a benchmark or base value to establish against the file to be tested.
From there you would basically have to do a line by line string by string (or char by char) comparison between the two files to determine changes between the base value and the current file (of course you can try to determine if the file is identical first but file size and creation date/time are not always good identifiers of sameness).
As for posting example code... sorry, don't have any pre-made and too tired to try to write it for you right now :twisted: but based on the information above you should be able to make a few educated steps in the right direction for what you're looking to do.
Don't be afraid to do some research on file reading to figure out how that works :)
I just went through about a dozen of them and all came up fine. What I might suggest is you make sure your PDF viewer (Adobe Acrobat Reader) is up to date with the latest version as sometimes version issues can cause viewing incompatibility. Alternately, it could just be latency in the download of the PDF file as each of the files I tested did start off with all black for about 1/4 second before loading on my screen.
You can make sure you have the latest viewer here. As a side note, Adobe likes to package a trial version of McAfee Security Scan Plus with their reader download, you can opt out of this however and I personally don't like it on my system.
Hope this helps :) Please mark as solved once your issue is resolved.
I'm no expert in the draw process but from what little I know the standard Graphics.Draw methods tend to be 'static' in their positioning. In order to achieve a "zoom" effect I would do something like the following (pseudocode not C# code cus I don't know the processes required per-se)
Based on this process you determine the existing center point and "zoom" accordingly to the same center point on your new ratio.
Hope that helps :) It's been a while since I used draw methods so I'm sorry I can't provide actual code for the scenario.
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.
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 …
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 ;)
Care to share the actual error? It may provide a clue as to what caused it :)
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 :)
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.
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.
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 :)
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.
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:
Perhaps if you gave a bit more detail...
Such as, why are you connecting to the database? Are there dynamically loaded objects in your site that require DB access? Are you sending information to the database from inputs on your site?
Do you have any knowledge of ASP.Net or VB or any other web-compatible programming/scripting languages for that matter? Is the database local to the site or on a server somewhere?
All of this information would be handy for someone to be able to better evaluate the question you are asking and to allow people to provide the correct type of help to fit your needs.
Its not even letting me include System.RegularExpression.
That's because I'm an idiot and it's supposed to be:
using System.Text.RegularExpressions;
Note to self: double check some stuff before posting on-the-fly :twisted:
This might work for your needs... you'll need to add "using System.RegularExpressions;" at the top of your code and this goes into your button click:
Button btn = (Button)(sender);
string btnName = btn.Name.ToString;
string[] btnSplit = Regex.Split(btnName, "button");
string btnNum = btnSplit[0];
btnNum will be the number portion of the button name of the button that called the click event.
Hope this helps :) Please remember to mark solved if your issue is resolved.
Well... let's see...
Function:
// creates a public procedure named AssignIt which takes an input string and internally refers to it as str as well as having a return property of string (meaning it sends a string result back to it's caller)
public string AssigningIt(string str)
{
//Some statements here...
AssignIt = str; // assigns string value of str to the AssignIt method
return AssignIt; // returns the current value of AssignIt method to the caller
}
and the other looks more like a method:
private string assignIt; //creates a private string called assignIt
public string AssignIt //Defines public method AssignIt
{
get
{
return assignIt; //set get value to return private string assignIt
}
set
{
assignIt = value; //uses calling string to assign value to assignIt
}
}
However, again, what I just demonstrated is a method, not a subroutine. I've actually never come across the concept of subroutines in C# myself, just methods and functions.
In looking for some more details on subroutines in C# I came across this which might help.
You might also find this reference a help in your attempt to go from VB to C#.
Hope this helps :) Please remember to mark as solved once your question has been resolved.
I just don't understand the 'I must have a gun' mentality. I'm sure that I'd be more likely to be shot if I carried one. Is it that carrying a gun is a civil liberty? Is that why many are so touchy about the chance of an 'inanimate object' being banned?
Not to say this applies to "all Americans" but it does apply to many of the gun lobbyists... The general argument is that it is within their rights as outlined in the constitution to have the right to bare arms in defense of their homes.
What many tend to ignore/omit in their mantra is that this right was established to provide a legal basis for the formation of an "organized local militia" in defense of their lands and property against foreign invasion (most notably from the then king of England).
In today's day and age this "right to bare arms" is well past obsolete but thanks to the founding fathers including it in the original bill of rights provides so many people such a strong point of leverage as to make it nearly impossible to repeal now.
You can create an entire website derived from C#/ASP.Net coding but you will need to have a strong working knowledge of HTML and possibly some of the other scripting languages out there like JavaScript and such to make some components work the way you want them to.
There is lots of information out there regarding C# as well as ASP.Net(C#) including tutorials and even classes you can take.
You say you asked a teacher about C# and all they told you was the .Net stuff... if that's the case you now know about the more common usage of C# coding in the workplace today. C# can also be used for desktop application development, however it's notably higher resource footprint over unmanaged code languages makes it somewhat less desireable for this.
What I recommend, look on msdn.microsoft.com, look on google.com, talk to your teacher again and if you're REALLY interested in learning C# or ASP.Net take a course in it.
Hope this helps :) Please remember to mark your thread solved when the issue has been resolved.
It is better to use the generic List type:
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { List<string> MyList = new List<string>(); MyList.Add("p001"); MyList.Add("p002"); MyList.Add("p003"); for (int i = 0; i < MyList.Count; i++) { Console.WriteLine(MyList[i]); } MyList.Remove("p002"); Console.WriteLine("#################### After removing:"); for (int i = 0; i < MyList.Count; i++) { Console.WriteLine(MyList[i]); } Console.ReadKey(); } } }
Also known as a "Collection" and darn you for getting up earlier than me and mentioning it first :P
But yes, your best bet is what ddanbe said as it dynamically increases it's size as items are added to it and can have items removed from it, reducing it's size dynamically, without having to insert null values as placeholders to overwrite them.
Don't forget to mark the thread solved once your issue is resolved :)
Just one last thing. It's about #content. There is a height:500px; value. Is it possible that div content determines it's height automatically based on the amount of text inside of it ?>
To be honest you can almost consider that height value to be a "max-height" value because a div's height is determined by the amount of content it contains(with the exception of "absolute" positioned divs).
Unfortunately what you got from me before is about as good as I can do at the moment, sorry :( Maybe someone else will be more insightful than me but I'm off to sleep.
Good luck though :)