|
hi guys, i want to picking row from my database(sql server 2000) with cycling form. for example my database contain.....
name age roll no
first row:- samuel 23 900041
sec row:- sam 22 900042
third row:- raja 20 900044
.....
in this my request i am retrive first row and then my second request i want to pick sec row as well as i move first row into third row...
so if u have any solution reply me asap..
|
|
|
|
|
Hello,
I'm having a problem Serializing/Writing the objects that were initially generated by xsd.exe and then extended (by adding attributes) via partial class. Since it will be hard to read if I paste all my code, I'll try to explain it instead.
XSD generates classes from the schema. IN my case let's call them:
public partial class ParentClass {}<br />
public partial class ChildClass {}
All of these are generated inside a DataModel.cs class.
So I created another DataModelEx.cs class where I added the following:
public partial class ParentClass<br />
{<br />
private string dataRootField = string.Empty;<br />
<br />
public string DataRoot<br />
{<br />
get { return dataRootField; }<br />
set { dataRootField = value; }<br />
}<br />
}<br />
<br />
public partial class ChildClass1<br />
{ private ParentClass parent = null; }
Adding these, when I try put values in the class and serialize it, this is the error that I am getting:
Error: There was an error reflecting type 'NAVITAIRE.SkyPlan.utility.data.DirectorySettings'.<br />
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel)<br />
at System.Xml.Serialization.XmlReflectionImporter.ImportElement(TypeModel model, XmlRootAttribute root, String defaultNamespace)<br />
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type type, XmlRootAttribute root, String defaultNamespace)<br />
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)<br />
at System.Xml.Serialization.XmlSerializer..ctor(Type type)<br />
at NAVITAIRE.SkyPlan.utility.Util.WriteDataToXml(String outputFile, Object data) in C:\workspace\PlanningSuite_Local_Dev\gui\src\utility\Util.cs:line 1741
My guess is that I may be missing some tags like the following in declaring my attributes:
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]<br />
[System.SerializableAttribute()]<br />
[System.Diagnostics.DebuggerStepThroughAttribute()]<br />
[System.ComponentModel.DesignerCategoryAttribute("code")]<br />
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]<br />
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
I am not familiar about these [] tags before declarations, so please help me out. I tried experimenting by placing some [System.Xml.Serialization.XmlIgnore()] before the new properties but it didn't seem to work, or maybe I just placed them incorrectly.
Thank you for your help!
Sincerely,
Rafferty
|
|
|
|
|
Nasty problem.
Make sure your class is marked with [Serializable]. Certain complex types cause problems too I believe. Dictionary<> and the sort. Try putting [XmlIgnore] infront of these (which will prevent serialisation) and see if that helps, you may have to use more primitive types if that helps.
[DebuggerStepThroughAttribute] prevents the debugger from stepping into the generated code, not always that helpful so just find and replace these with an empty string may help with debugging.
Regards,
Rob Philpott.
|
|
|
|
|
Found the problem. Seems like a cyclical problem happens when you use "parent" objects in classes like these.
Thanks guys!
Rafferty
|
|
|
|
|
I'm using ClickOnce for deploying my smartclient (CAB) application. There are a lot of modules in my applications. When the new version of those modules have been deployed, I wanna show the list of modules that need to be updated to the user before downloading those latest version.. ( like Firefox extension's auto-updates style )
My question is: How can I get the list of latest module?
Thanks in advance.
|
|
|
|
|
hi all
plz help me
i am inserting date to the text box on the datagrid template.There is 2 column for that. one receive date and the other due date. due date should be greater than receive date. and the date format is dd/mm/yyyy. how to validate this. since the date format is dd.mm.yyyy, am not able to compare it with different month.plz help me to solve this. am doing this from past 4 days. but didnt end up with a solution
sample code is given below
if(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text != "")
{
try
{
DateTime txt=Convert.ToDateTime(((TextBox)(dgDetailData.Items[total].Cells[6].Controls[1])).Text);
DateTime tst=Convert.ToDateTime(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text);
string date=month+"/"+day+"/"+year;
if(DateTime.Compare(txt,tst)>0)
{
lblmsg.Text="error";
lbl1.Text=date.ToString();
}
else
{
lbl1.Text=txt.ToString();
InsertParam[9].Value=Production.FORMATYMONDTIME(((TextBox)(dgDetailData.Items[total].Cells[7].Controls[1])).Text);
}
}
catch(Exception err)
{
RegisterStartupScript("startup","<script>window.alert('1.Error:"+err.ToString()+"')</script>");
}
}
else
{
InsertParam[9].Value=DBNull.Value;
}
In this code the error occuring is if the received date is 01/10/2007 n due date id 30/09/2007, it is inserting value. if it is of same month it is working properly. ie 01/10/2007 n 10/10/2007 it accept and if it is 10/10/2007 n 01/10/2007 it is not accepting.
|
|
|
|
|
Hey all,
I've long been using CodeProject as a valuable resource, but have come to a problem that I can't find a solution for.
I have a .NET 2.0 app, written entirely in C#. In it, I have several controls (some simple, some complex), which I'd like to display detailed data about in a custom tooltip. I've got the tooltip content done and can easily make it be a Form or UserControl, whichever the tooltip class would need.
Ideally, I'm looking for some free class, where I can just do something like...
<br />
WonderfulToolTip tip = new WonderfulToolTip(myTooltipContentControl);<br />
<br />
...<br />
<br />
tip.Show(new Point(300, 400));<br />
<br />
...<br />
<br />
tip.Hide();<br />
I've looked around here, and other websites, and seen at least example of this working, however it wasn't free, and the code seemed way too in-depth, since it was a full control library, and I wouldn't be able to pick out just part I need. I found several different related options, like comboboxes with custom tooltips, or specific custom tooltips that didn't allow you to provide your own control. I know the funcitonality is there, but untangling it from the mess of things that aren't what I want seems very daunting. I've been a .NET C# developer from the start, so my eyes tend to glaze over when I see a huge chunk of code filled with windows API calls, endless enums, and other native code. I'd prefer not to reference any huge control libraries; I'd just like a class or two to add to my project.
Perhaps the desire for a simple custom tooltip class is a bit idealic, I'm not sure. Can anyone point me to the closest I can get, if nothing like what I'm looking for is available? Thanks very much for your time!
|
|
|
|
|
Will the MouseHover event suffice?
|
|
|
|
|
I'm not sure what you mean. I may use MouseHover to trigger when to show the tooltip, but I'm looking for how to display a usercontrol as a tooltip.
|
|
|
|
|
|
Yeah, I have. I'm looking for something I can add to my C# project, so either C# of VB.NET (I could translate it from VB fairly well, or use VS's converter).
|
|
|
|
|
Any other ideas? Could really use something simple.
|
|
|
|
|
While I haven't found what I was looking for, I did find another solution.
I had thought that the built-in System.Windows.Forms.Tooltip class handled text only... And basically that's true. But I just noticed (Thanks PNelson!) that it's got OwnerDraw functionality, so I'll just draw it myself.
|
|
|
|
|
txtInterestRate.Text.ToString = 12;
What am I doing wrong???
Im currently a student, trying to complete a task...and im stuck!
The code is currently under a method in my application.
Help Please
Im trying to set the InterestRate textbox value to 12.
|
|
|
|
|
OlieColie wrote: txtInterestRate.Text.ToString = 12;
What am I doing wrong???
Well, Text already returns a string , so there is no point in asking it to make a string from something that already is a string . It would be pointless.
You want to make the number a string, so perhaps you might want to write 12.ToString() , but if you are dealing with literal values, why not just say "12" and be done with it.
|
|
|
|
|
You have asked this at least three times across at least two forums. Please ask once in the right forum, and leave it at that.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Indeed, only post once.
Just to clarify, ToString() is a function that returns the value of an object, as a string, and it can't be set.
The TextBox.Text property is all you need, it is the text of the text box, so you can either do
txtInterestRate.Text = 12.ToString();
or simply
txtInterestRate.Text = "12";
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
My favorite word is still Callipygian.
|
|
|
|
|
Hi - I mean no disrespect to you in this post.
1 - you are a student, so I assume you are being 'taught'.
2 - the first chapter in most, if not all, C# beginner book handles strings, usually in the form string.Format("{0}" , 12) and, like the previous answers, obj.ToString() .
3 - are you paying for your course, and at what institution?
4 - Do you have any C# books?
I can't believe, in all honesty, that a C# student, would not have been taught how to convert a number to a string.
Seriously, how much are you actually taught, and how much are you left to figure out on your own, and are you given any learning material, or even any pointers on how to find out his info for yourself?
Vote me down if you want, but this is not meant as abuse - just pure curiousity at what is being taught.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
txtInterestRate.Text="12";
try this
|
|
|
|
|
How do I set a textbox value to 12.
I tried the ToString method, but it did not work.
|
|
|
|
|
value? you probably mean TextBox.Text which holds a string; if you want to convert
that to some other type, you probably need a Parse or better yet TryParse method
(see int, double, DateTime... classes).
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
|
hi
please help me I want to inset new rows in the DataGrid in C# in developing SmartDeviceApplications using visualstudio.net2005 to develop an application but i until this time cann't insert new rows into the datagrid nevertheless i can select data from tables into the datagrid but I cann't edit or add new row into this datagrid pleaaaaaaaaaaaaaaaaaaaaaaaaaaaaase help me.
|
|
|
|
|
Hi all,
I'm a new programmer and I've come across a problem that I'll need some help in.
class MyObject1{...}
class MyObject2{...}
class MyObject3{...}
class MyObject4{...}
public void test(object a){
Type a = a.GetType();
//Now what?!
}
//Somewhere in main...I call test and pass it an instance of one of these objects...
test(new MyObject1());
test(new MyObject4());
test(new MyObject3());
test(new MyObject2());
What I'd like to know is how to convert variable 'a' into whatever object was passed into test();
This is probably a silly question but I'm learning....
Thanks in advance.
Humble.
|
|
|
|
|