|
I would like to know how to search for a certain record by a value in a non keyed column, then being able to update that record to the values in another table. Here is what I have used in the past to locate a record by a primary key, is there a way to do the same with out a keyed column as a search value.Do I need to set the primary key temporarily to the new column I need to search?
DataSet1.HorseJoinTableDataTable dth = new DataSet1.HorseJoinTableDataTable();
DataSet1TableAdapters.HorseJoinTableTableAdapter tah = new FBWinMobileSync.DataSet1TableAdapters.HorseJoinTableTableAdapter();
dataSet1.EnforceConstraints = false;
tah.FillByMod(dth);
fB7MobileDBDataSet.EnforceConstraints = false;
foreach (DataSet1.HorseJoinTableRow dr in dth.Rows)
try
{ How can I accomplish this below on a non keyed column search
FB7MobileDBDataSet.HorseRow newMobileHorse = this.fB7MobileDBDataSet.Horse.FindByCODEHorseName(dr.CODE, dr.HORSENAME);
newMobileHorse.CODE = dr.CODE;
newMobileHorse.Stable = dr.STABLE;
newMobileHorse.HorseName = dr.HORSENAME;
newMobileHorse.Active = dr.ACTIVE;
newMobileHorse.AngleLF = dr.ANGLELF;
newMobileHorse.AngleLH = dr.ANGLELH;
newMobileHorse.AngleRF = dr.ANGLERF;
newMobileHorse.AngleRH = dr.ANGLERH;
dataSet1.EnforceConstraints = false;
//if(dr.DUEDATE.ToString().Trim()=="")
if (dr.IsNull("DUEDATE"))
dr.DUEDATE = DateTime.Today;
newMobileHorse.DueDate = dr.DUEDATE;
if (dr.IsNull("LASTCOST"))
dr.LASTCOST = "0";
double D = Convert.ToDouble(dr.LASTCOST);
newMobileHorse.LastCost = D; //Convert.ToDouble(dr.LASTCOST);
newMobileHorse.Totals = 3;
//Equals no change to record
if (dr.IsNull("LASTDATE"))
dr.LASTDATE = DateTime.Today;
newMobileHorse.LastDate = dr.LASTDATE;
newMobileHorse.LengthLF = dr.LENGTHLF;
newMobileHorse.LengthLH = dr.LENGTHLH;
newMobileHorse.LengthRF = dr.LENGTHRF;
newMobileHorse.LengthRH = dr.LENGTHRH;
newMobileHorse.MainWork = dr.MAINWORK;
newMobileHorse.NickName = dr.NICKNAME;
newMobileHorse.SizeLF = dr.SIZELF;
newMobileHorse.SizeLH = dr.SIZELH;
newMobileHorse.SizeRF = dr.SIZERF;
newMobileHorse.SizeRH = dr.SIZERH;
newMobileHorse.Weeks = Convert.ToInt16(dr.WEEKS);
newMobileHorse.Delete = dr.DELETE;
newMobileHorse.LengthList = dr.LENGTHLIST;
newMobileHorse.NeedsNewFr = dr.NEEDS_NEW_FR;
newMobileHorse.NeedsNewHd = dr.NEEDS_NEW_HD;
newMobileHorse.StartAngleLF = dr.START_ANGLE_LF;
newMobileHorse.StartAngleLH = dr.START_ANGLE_LH;
newMobileHorse.StartAngleRF = dr.START_ANGLE_RF;
newMobileHorse.StartAngleRH = dr.START_ANGLE_RH;
newMobileHorse.StartLengthLF = dr.START_LENGHT_LF;
newMobileHorse.StartLengthLH = dr.START_LENGTH_LH;
newMobileHorse.StartLengthRF = dr.START_LENGHT_RF;
newMobileHorse.StartLengthRH = dr.START_LENGTH_RH;
newMobileHorse.Front = dr.FRONT;
newMobileHorse.Hind = dr.HIND;
--------------------------------------------------------------------------------
Jon Stroh
Thanks Jon Stroh
|
|
|
|
|
DataSet ds = new DataSet();
DataTable table = new DataTable();
ds.Tables.Add(table);
DataRow rows[] = table.Find("MyField = 'Hello World');
That should do the trick.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
Thank You very much, I sure wish I could learn how to search vs2005's help file. Even after you gave me this code I can't find any help on .Find for tables. Thanks for your reply though with out it I would be dead in the water
Jon Stroh
|
|
|
|
|
I am using a Repeater to make a menu off a SiteMap. I also made a custom user control that is a cool looking button. The button's events work fine and the properties work fine as long as I am not in a repeater control. If I use the repeater control I get a NullReferenceException because as far as I can see all my properties are null on postback.
How can I get all my properties to save?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Found the solution. I had to go add ViewState objects to my custom control to get it to have ViewState properties, I assumed it would do it itself, I don't know why I made that assumption.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Iam currently in the middle of writing a screen grabbing app in c#. One of the requirements for the application is that the form or window of my application doesnt appear in the grabed images. Under XP this was easy as I just set the form to not appear in the task manager in the form properties in visual studio and when it was minimised you couldnt see it at all.
The same nearly applies to vista, I cant see the window when minimised and it doesnt appear on the taskbar. However when it is minimised I seem to get a floating tab of the window in the main desktop.
I dont know if this can be disabled with a vista control panel setting or there is some other way of doing it with code but I cant seem to find it either way. Can anyone possibley help with this.
Much appreciated Mike
|
|
|
|
|
How can i get the content of selected row on the double click event of datagridview for 2005?
reply immediatly
thanks
|
|
|
|
|
nilam11 wrote: reply immediatly
Please request humbly.
Regards,
Arun Kumar.A
|
|
|
|
|
nilam11 wrote: reply immediatly
Please Don't put this. This is not good.
Please go with Soft and Humble Request.
Regards,
Satips.
|
|
|
|
|
Hi
Is it possible to create a database SQL application without using asp.net. Only C#.Net.
There is one project to create an application for a school with 8000 students. So have to keep record of all the students and stuff , n things like registeration etc etc...SO need a heavy database...So what do you guys suggest in this case...
Thanks
|
|
|
|
|
Try to write a subject line that says something about the thread.
Software_Specialist wrote: Is it possible to create a database SQL application without using asp.net. Only C#.Net.
Yes, of course.
Software_Specialist wrote: There is one project to create an application for a school with 8000 students. So have to keep record of all the students and stuff , n things like registeration etc etc...SO need a heavy database...So what do you guys suggest in this case...
If you are going to be running a single instance of the application, any database will be able to handle that amount of data, even an Access database.
If you are building something that are going to be used from several instances of the program, or is going to be incorporated into an intranet/extranet, or if you see any of this as a likely development in the future, you should use a more stable database solution, like MS SQL Server.
You don't have to forsee any future needs, though. MS SQL Express is fully compatible with a full grande MS SQL server, so it would be fairly easy to upgrade if needed. Any type of database can be imported to another, but there are some differences in connection, data types and sql queries.
-- modified at 9:28 Sunday 17th June, 2007
---
single minded; short sighted; long gone;
|
|
|
|
|
But i guess these kind of applications are better if done using ASP.Net as it could be worked via webpage(internet) or intranet(if want to use it locally with in campus).
Please correct me if am wrong.
If i am right then i should build this application using ASP.NET, C#.NET, ADO.NET, SQL server 2005
Thanks
|
|
|
|
|
It depends on what the application has to be able to do, really.
Most applications that work against a database doesn't really benefit much from being windows applications, as they are working against a central database anyway.
Web applications have some benefits over windows applications, though. All that you need to use it is a browser, you don't need any .NET framework or specific datbase drivers installed. You actually don't need the computer to run Windows at all.
Unless you have some special requirements in the application that needs it to be a windows application, you can very well make it a web application.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
I have written a script where user can upload a file into a pre-defined destination file. But I want to add couple features to this
1) I want to validate so that only preferred users can access this application.
2) Everytime a user uploads a file, a log table needs to be updated with the user name(may be windows login name), upload date& time, File name etc.
Can some one help me with the scripting part for this pls.
Thank You
|
|
|
|
|
how we used rdlc report throw code with Parameter / or How make a rdlc report With Runtime,
Thanks
|
|
|
|
|
Can you tell me a bit more? I don't understand what you're asking.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
<b>Suppose I have numeric values in my listbox. How do I add(addition) them and display the result in textbox. Plz help me guyz. I need the code both in VB.NET as well in C#.NET. plz plz help me out.</b>
Mash
|
|
|
|
|
hi,
one way is to iterate through all the items in the list and add them.
you could try the following:
object[] obj= new object[listBox1.Items.Count];<br />
listBox1.Items.CopyTo(obj,0);<br />
int sum = 0;<br />
foreach( object o in obj)<br />
{<br />
int tmp = Int32.Parse((string)o);<br />
sum += tmp;<br />
}<br />
textBox1.Text = sum.ToString();
and one more thing please don't post the same message in multiple forums.
hope this helps
regards
|
|
|
|
|
Iterate over the items of the listbox and sum them
|
|
|
|
|
Well the concept of listbox is that it holds multiple values just like an array but the listbox control treats every data as string .lets assum that we are having a listbox name lbt1 holding seven values each value on each index.
We have to apply a loop first untill the total number of items in lbt1.e.g
// declar/initiate variables
int val=0;
int addval=0;
int total=0;
for(int i=0;i<this.lbt1.items.count;i++)
{
val=int.parse(this.lbt1.items[i].tostring());
addval=addval+val;
}
this.txt1.text=addval.tostring();
<div="" class="ForumSig">By Lucky Hamad
|
|
|
|
|
i want to use directx to capture screen then save to file,because i know only a little about managed directx,so the first i Want to create a device link to the desktop,then copy the data from that device,but after i instanced a device,i can't use it,i do not know why, my code like this:
IntPtr hwnd = WinApi.GetDesktopWindow(); //i use api to get hwnd
IntPtr hdc = WinApi.GetDC(hwnd);
Device device = new Device(hdc); //instance here
//then i didn't know how to get the data i use this code
Texture t = Device.GetTexture(0); //can't work here
//or i use this
Surface s = device.GetRenderTarget(0); //also can't work
i really don't know how to do can get the data from the screen then save to file,i hope someone can help me to deal with this question,or you can give me a method to capture the screen,but do not use the gdi+ or graphics.CopyFromScreen method, i only want to use directx to do that. thanks.
|
|
|
|
|
You don't want to use DirectX for that, it's just not needed, and doesn't really help. You're on the right track, you just need to copy from the hdc to a bitmap. The desktop is not drawn using DirectX
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
thanks for your answer, but if i want to save the screen continually like a vedio, i will save 24 bitmaps per second, this will use a lot of CPU and memory, so i'm finding a way to save the screen more quick and less use up. could you tell me how to do that,thanks very much.
|
|
|
|
|
Hi,
In my business logic directory I have a Property class. The namespace for this class is:
namespace MyWebsite.BusinessLogicLayer
{
public class Property
{
}
}
In my website, the I have a backend (admin) control panel where property is added, and the namespace is:
namespace MyWebsite.Web.ControlPanel.Property
{
public partial class InsertProperty : System.Web.UI.Page
{
}
private void InsertNewProperty()
{
// Here I try to insert a new property
}
}
In the InsertNewProperty() I get all the values from the input controls. When I try to create a new instance of the Property class it doesn not find it, instead it gives me an option to chooose only from the Property namespace. My reference to the Property class is like this in the .aspx page:
using MyWebsite.BusinessLogicLayer;
So I do not know what it does this. Can someone please advise me correctly?
Regards
ma se
|
|
|
|
|
hi,
in such conditions, use full name:
eg:
MyWebsite.BusinessLogicLayer.Property p = new MyWebsite.BusinessLogicLayer.Property()
hope this helps.
regards
|
|
|
|