|
davidcooler wrote:
write a C function
Hope you are aware that this is the C# forum.
Anyway, it's a nice programming task you described, but where is the problem or do you expect us to write the whole thing for you?
www.troschuetz.de
|
|
|
|
|
please send me the code for editing and updating data in a data grid.in C# ASP.net.
I have used the grid properties given in .net
|
|
|
|
|
hi there,
I'm pretty sure that there are a ton of articles about this on CP
btw, take a look on this
http://www.codeproject.com/aspnet/EditGrid.asp
<< >>
|
|
|
|
|
i made the following stored procedure
CREATE procedure databasecreation (@a varchar(20))
AS
declare @strquery varchar(1000)
SET @strquery = 'create database '+@a+ ''
EXEC (@strquery)
ALTER procedure databasedeletion(@a varchar(20))
AS
declare @strquery varchar(1000)
SET @strquery = 'DROP database '+@a+ ''
EXEC (@strquery)
when executing it in front end C#
code;-
SqlConnection c = new SqlConnection("server=dbasvr03;uid=sa;pwd=sa;database=banking");
private void button1_Click(object sender, System.EventArgs e)
{
String databasename;
databasename =textBox1.Text;
c.Open();
SqlDataAdapter MyDataAdapter= new SqlDataAdapter("databasecreation ", c); MyDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
MyDataAdapter.SelectCommand.Parameters.Add(new SqlParameter("@a",
SqlDbType.VarChar,20));
MyDataAdapter.SelectCommand.Parameters["@a"].Value = databasename;
MyDataAdapter.SelectCommand.ExecuteNonQuery();
Console.WriteLine("DATABASE CREATED");
c.Close();
}
AT EXECUTION THE FOLLOWING ERROR COMES-
databasecreation error: identifier 'databasecreation' out of scope
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
PLEASE GIVE A SOLUTION
-- modified at 2:57 Friday 23rd September, 2005
|
|
|
|
|
hi there,
firstly, I saw the parameter name in C# code is not the same as the parameter is declared in the store proc
check it again
<< >>
|
|
|
|
|
Hi,
I need to trap a desktop locker activating along with the screen saver which is activating after 3mins machine idle. I need to by-pass/ Detect this occurance. This can be occured from Keyboard where user types this key combination OR Software generated Even...
I tried with forcefully calling MouseMove after an interval, to deactivate the screensaver... but not succeed..
Please give some ideas....
Thanks in advance....
Krishna kumar.R
krishnakumar75@rediffmail.com
Krishnakumar
krishnakumar75@rediffmail.com
|
|
|
|
|
You can't trap Ctrl-Alt-Del. It's theonly key combination you can't control. Unless you write your own GINA.DLL. Come to think of it, you'll probably have to do the same thing in order to unlock the screen saver.
What are you trying to do with this?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hiya, Why not check out Paul DiLascia's trapkeys - an excellent piece of code - it might get you in the right direction. It basically involves setting a global keyboard hook and it checks if ctrl-alt-del was pressed, you could easily modify it to set off a flag or something. Google for TrapKeys - it was mentioned in a recent edition of MSDN!
Good Luck,
Tom Brennan.
#define STOOPID
#if STOOPID
Console.WriteLine("I'm stoopid!");
#endif
|
|
|
|
|
You might want to reply to the OP so he gets the notification that you replied to him, not me.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi all!i have a code like this.The port.Read(4) mean that i read 4 bytes from serial port..i had convert from byte [] to char [] and now i want to convert from char [] to float? mean that my final answer must be in float type.How can i do it?Thanks!
private char [] Read_Data = new char[4];
{
Read_Data = Encoding.ASCII.GetChars(port.Read(4));
}
|
|
|
|
|
play around System.Convert.Tofloat() or ToDouble
sorry if I is not correct.
<< >>
|
|
|
|
|
hi lmoelleb!
let me tell u the whole scenario.
here is a structure
struct myStruct
{
string firstname;
stirng lastname:
};
now in a method.
myStruct abc = new myStruct();
abc.firstname = "feedo"
abc.lastname = "deedo"
Template = "my first name is <firstname> and last name is <lastname>.";
now i want to replace the tage <firstname> with the value of abc.firstname and <lastname> with abc.lastname. off course i ll ve to get the variable name of abc.firstname and then search it in Template and replace the value of <firstname>.
i know that there r other ways too (like by 2 structurs) but i want to do it as above. can u or anyone else help me. i ve seen the system.reflection namespace anyway, but vent found any thing.
regard.
AbdulBasit Hammad.
|
|
|
|
|
Anybody Tell me how to install C# ?
|
|
|
|
|
|
C# is installed with the ".NET Framework", download it from windows update or grab a redistributable package around the net or msdn site. Install the framework and you'll have C# language, compiler and other libraries completly installed in your system.
If you install .NET Framework 1.1 then also download the service pack 1.
With these packages you're ready to write software. You'll need an IDE if you don't plan to write software with notepad so download a good IDE like SharpDevelop http://www.icsharpcode.net/OpenSource/SD/Default.aspx[^], it's free.
AFTER you installed the framework & the service pack, if you want offline documentation about the C# language specification, .NET Framework, classes and many others then download and install the .NET Framework SDK, it's very usefull and it has code samples and tools.
A useful tip: If you plan to use notepad to write code then add the path of the C# compiler to the system variables. So at compile time you can type at the console "csc" and not the whole path to the compiler. Notepad is useful if you want to learn in deep the theorical C# specifications cause the times you need to look at the documentation is longer than "drawing" software with an automated IDE, this way you memorise namespaces, find new interesting info and see how things work.
Hope it helps you,
Heinz
-- modified at 14:35 Friday 23rd September, 2005
|
|
|
|
|
i am a novice to c# programming. working on a mini project.
the problem:
have a hidden textbox,2 visible text boxes,2 cal controls,submit button
txtCurDate-hidden
txtStartDate,txtEndDate-visible
validation summary
on page load i made the calendars invisible,validation summary-disabled,disabled clientscript
we have two image buttons and in the click event of hese two i placed the code
set the calendar ctrl visible property true
i also have a validation summary control
on click of submit button the validation has to take place, i enabled the validationsummary,enabled clientscript property of validation summary.
the validation with validation summary being shown is taking place but the control is lost.no other buttons are working once i press submit.
can u tell me how to get the control back to the page after the validation summary takes place on click of the submit button?
this is a part of our project.
jyothipradeep_satyamcorporation
|
|
|
|
|
|
//textboxes:txtStartDate,txtCurDate,txtEndDate
//ImageButtons:2(one for start date,oth end date)
//Calendar Controls:2(corr to each image button)
//Compare validators:2
//cmpv1:start date>current date
//cmpv2:end date>start date
//made displays of cmpvs none
//used validation summary
//the pbm i mentioned at the end
private void Page_Load(object sender, System.EventArgs e)
{ txtCurDate.Text=System.DateTime.Now.ToShortDateString();
Calendar1.Visible=false;
Calendar2.Visible=false;
}
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Button2.Click += new System.EventHandler(this.Button2_Click);
this.Calendar1.SelectionChanged += new System.EventHandler(this.Calendar1_SelectionChanged);
this.Calendar2.SelectionChanged += new System.EventHandler(this.Calendar2_SelectionChanged);
this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);
this.ImageButton2.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton2_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
Calendar1.Visible=true;
}
private void ImageButton2_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
Calendar2.Visible=true;
}
private void Calendar2_SelectionChanged(object sender, System.EventArgs e)
{
txtEndDate.Text=Calendar2.SelectedDate.ToShortDateString();
}
private void Calendar1_SelectionChanged(object sender, System.EventArgs e)
{
txtStartDate.Text=Calendar1.SelectedDate.ToShortDateString();
}
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write("form submitted");
}
private void Button2_Click(object sender, System.EventArgs e)
{
txtCurDate.Text="";
txtStartDate.Text="";
txtEndDate.Text="";
}
// i think this would be more clear
//on validation if it is invalid,all the buttons //won't be working b'coz of validation
//but i want my cal ctrls to be hidden
//and to be displayed on click of a button or //doing sth else
// i know this is agnst the basics but is there any //sol
jyothipradeep
|
|
|
|
|
hi sreejith, if possible give me ur mail id so that i can send u the webform.aspx file itself
jyothipradeep
|
|
|
|
|
pradeep_electro@yahoo.co.in
jyothipradeep
|
|
|
|
|
public can access by all class, internal can access by it's namespace, protected can access by it's inherit class.
How to access a member only by special base class or a class which implement the special interface?
=== Game is power! ===
|
|
|
|
|
Internal code can be accessed only from the same assembly, not namespace.
As far as I know, there's no way to do what you want to. protected is useful if only a derived class can call the method. Otherwise make it public and trust your caller.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Impliment a containment or Nested class or a Has-a relation.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
how do I iterate through each item in the listbox using the foreach command? I can't figure out the variable name or type for each listbox item. do you have any ideas?
Thanks,
Stephen
|
|
|
|
|
foreach(object oLB in listBox1.Items)
Because a listbox can define the value member of any object to display, it contains objects. Use something more specific assuming that you know what's in there.
Christian Graus - Microsoft MVP - C++
|
|
|
|