|
If a method accepts only 3 parameters then you must send exactly three. Send fewer and it may crash the application, send more and the extras will be ignored.
|
|
|
|
|
I have written a code. But don't know where is the error. Please help.
<pre lang="c#"><pre>using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace GridView
{
public partial class practise : System.Web.UI.Page
{
public static List<User> listuser = new List<User>()
{
new User() {ID = 1, UserName = "Dhruv", Password = "hello"},
new User() {ID = 2, UserName = "Gaurav", Password = "12345"},
new User() {ID = 3, UserName = "Rahul", Password = "asdfg"},
new User() {ID = 4, UserName = "Guru", Password = "qwerty"}
};
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
listuser = new List<User>();
GRIDDATA.DataSource = listuser;
GRIDDATA.DataBind();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
User data = new User();
data.UserName = TextBox1.Text;
data.Password = TextBox2.Text;
bool UserExists(string userName, string password)
{
return listuser.Any(a => a.UserName.Equals(userName, StringComparison.CurrentCultureIgnoreCase) && a.Password.Equals(password));
}
if(UserExists(data.UserName, data.Password))
{
Response.Redirect("https://www.googel.com");
}
}
}
public class User
{
public int ID { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
}
}
|
|
|
|
|
Dhruv Nunia wrote: googel.com There it is.
If you had an exception, please paste the entire exception. Also, if you create the list anew, you have to fill it again too, otherwise you're binding to an empty list.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
You'll get an "insecure connection" error, but Google have actually registered googel.com and set it to redirect to google.com .
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I forgot to foofle that first, sorry. But technically it is an error and it was pointed to
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Wildlife around the planet has started to act really strangely, but I never expected to see it extend to CP...
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Wildlife, by definition, acts naturally. I have no clue what you are trying to say, and Google isn't being helpfull either.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
"helpful"
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I try to be
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I am creating a C# windows application. The processes are listed in a listview as subitems. How do i get a processes start time and duraion it has been running?
|
|
|
|
|
BenchMarkDotNet, open-source: [^]
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
If you have a list of Process Class (System.Diagnostics)[^] components, just use the provided properties like StartTime , ExitTime , TotalProcessorTime , and UserProcessorTime . These can be used to calculate the run time (current time resp. exit time minus start time) and the kernel processor time (total processor time minus user processor time).
Note that you have to call Refresh() to get actual values and should check if the process is still running when the list has been created some time ago.
|
|
|
|
|
is there any code to visual studio that till the sql table is updated the button doesnot get visible in web form
<asp:button id="Button1" runat="server" text="Your Quortation Is Ready Click Here" visible="false" cssclass="btn btn-danger" onclick="Button1_Click">
i want code for this button
plz help
|
|
|
|
|
Member 13870544 wrote: is there any code to visual studio Yes.
Member 13870544 wrote: i want code for this button Hire a programmer or learn to code. Learning would probably go quicker, it's not that hard to hide or show a button.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
You just mentioned the code for button but you need to share what have you tried to hide it if that code is not working.
modified 20-Sep-20 21:01pm.
|
|
|
|
|
How much is a Quortation?
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
On the open market, they can run as high as $125, so try to find them on the black market if possible. That's where you'll find an object's true worth.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
use asynchronous calls, disable button until the call being processed
|
|
|
|
|
Good day, I need to do Something like this https://youtu.be/ecvunlsNm9k But Instead Of using tables, using textboxes In one form, and with different Files, let me explain you with an example: In Form 1, There are 2 Textboxes, and 1 button that button opens a file like in the video, but with the difference that can open different Files (Ex. File A and file B) like File A in one Textbox and File B in the second one. What I Have Tried I've tried doing a list in the application settings of type file, and when the form 1 loads do a for each loop like foreach (File in List) //Deserialize file in List But it doesn't allow me to do lists with 'file' type. Thanks. Update And what if I save Two strings in a XML file, and let's say that now there are 4 textboxes, 2 for file a and another 2 for file B, how can I deserialize that info and place it into that textboxes?
|
|
|
|
|
You cannot create a List<File> because the File Class (System.IO)[^] contains only static methods, you cannot instantiate a File object. But you could create a list of filenames that you wish to use. As to deserialising multiple XML files, there is no good reason why it would not work.
|
|
|
|
|
Thanks, but any idea of how could I create that list?
|
|
|
|
|
|
PS: Mi code is the same code of the video
|
|
|
|
|
I also have this question posted on Unity as well, but I figured that branching out for answers wouldn't be a bad thing.
Unity is primarily a Game Engine, but I am using it to make a non-game app. What I essentially need to have happen is that I take in a email, parse it- pick and choose what I need out of it, then send and display another email as well as display graphically that edited version.
As of right now, I am using EAGetMail library to try and keep track of the messages and then I am hoping I can access them while the "game" (application) is running. I know that Unity has a way of sending out emails obviously, as developers want to send out surveys and vital information, but as far as receiving those emails during game runtime, that seems like a big stretch and there is probably an easier way to do this.
If you have any information that would be helpful! Looking for ideas and concepts and maybe a little example code.
|
|
|
|
|
Things will make a lot more sense if you first create a console or windows app to "test" the "email logic".
It shouldn't be that hard to integrate "emails" into Unity; the fact that you are asking the question means:
1) You do not understand Unity "scripts"
2) You do not know how to "partition / package" code properly
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|