|
Hi,
i have to make an application that will simply have one form and one DataGrid control on the Form. i have to query from oracle database based on some criteria entered by the user. DataBase can consist of 100 Tera Bytes of data that is why i want to use paging. i tried to find some sample code/artical that will tell me how to do paging in C#. Every one is doing paing with some tricky select command using in clause for omitting the results that user don't want to see. In case of small data this select technique will work fine but in case of large data will it not be very slow. so my question is, Is there any other way to do paging.
Thanks & Regards,
Omar Lodhi
|
|
|
|
|
Hello,
Though I'm relatively new to C# development, (I mean REALLY new, so please go easy on me... lot's of descriptions) I'm always willing to try examples, and play around. I have somewhat of a background of C, so as long as there is descriptions of what everything does, the syntax wont scare me. I would like to create a tiny program that cleans the Windows XP Registry of all keys with the word "SQL", for the company I work for. If any of you have ever tried to delete SQL Server, you'll know what a giant pain it is. So, we've found, after running all the SQL uninstallers, if we wipe the registry of everything SQL... re-installing it is a breeze! Hence my program. Is there some type of code that I can play with that will scan the registry for everything with the word "SQL", and then, give you the option to delete everything? I think by automating this process like this, it will make it easier for our clients to re-install SQL Server.
Your help is much appreciated guys, and will probably help me strengthen my programming skills with C#.
|
|
|
|
|
The classes you'll be interested in is Microsoft.Win32.Registry and Microsoft.Win32.RegistryKey . Those classes have methods on them for retrieving different keys, subkeys, and values in the registry.
You can compare strings by using the various methods on the System.String class:
string someKey = "helloSql!";
if(someKey.Contains("Sql"))
{
...
}
You can also do some culture-specific and case-specific string operations:
int indexOfSqlInString = someKey.IndexOf("SQL", StringComparison.InvariantCultureIgnoreCase);
if(indexOfSqlInString != -1)
{
...
}
If you're really brave, you can try out regular expressions found in System.Text.RegularExpressions .
|
|
|
|
|
td00 wrote: Is there some type of code that I can play with that will scan the registry
I am not aware of any searching Registry API[^]. Therefore you would have to walk (enumerate) the registry get the strings and perform your comparisons.
led mike
|
|
|
|
|
Hi, I'm trying to write a basic windows game, at the moment all I want to do is load in a background image (i've created as a jpg.) and then I want to create a sprite and move this around my screen. Pretty basic I suppose especially for you c# guru's out there, however i'm getting an error when compiling and running my program so far. I've just instructed it to load in my background and i'm getting the following:
Resource 'background.jpg' cannot be found in class 'Game.Form1'.
Here is all my code so far for my program:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data;
namespace Game
{
public partial class Form1 : Form
{
// insert private bitmap background
// and bitmaps references to main sprite
// and movement int x/y move etc.....
private Bitmap background = new Bitmap(640, 320);
private Bitmap car;
private Bitmap player;
public Form1()
{
InitializeComponent();
//player = new Bitmap(GetType(), "player.jpg");
//car = new Bitmap(GetType(), "car.jpg");
Bitmap background = new Bitmap(GetType(), "background.jpg");
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
Graphics g = Graphics.FromImage(background);
for (int x = 0; x < 640; x += 90)
for (int y = 0; y <= 290; y += 90)
{
g.DrawImage(background, new Rectangle(x, y, 90, 90)); // GraphicsUnit.Pixel);
}
}
}
}
Many thanks if anyone can help me
|
|
|
|
|
lee.hallows wrote: New Programmer Help Please!
This subject line does not convey any useful information.
Pretty much everyone who posts a new thread here is looking for help. And the fact that you are a new programmer is not as relevant as other details.
Please see rule three of the posting guides.
|
|
|
|
|
Thanks for ALL your help, NOT. Whats wrong with the subject heading?
I only posted this because I thought i'd get a quick answer as it isn't the most complex thing i'm trying to write but i've hit a problem due to being a beginner. If this is the so called help you get on here I won't bother.
|
|
|
|
|
lee.hallows wrote: Whats wrong with the subject heading?
It contains nothing of your actual problem.
The fact that you are a "new programmer" doesn't mean anything. There are many experienced programmers just migrating to the .NET Framework that might have the same problems as you.
Also, "Help Please!" is redundant. Everyone here is looking for help.
A subject line of "Bitmap problem", "Resource problem" or "Loading Bitmap from Resource problem" would have been better and fit with the posting guidelines.
|
|
|
|
|
lee.hallows wrote: Whats wrong with the subject heading?
For one it indicates you CAN'T READ. How to get an answer to your question[^]
3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
If people don't think you can read why would they bother posting a reply that you would have to READ?
Would you like to ask any more questions?
led mike
|
|
|
|
|
PlayByTheRules wrote: This subject line does not convey any useful information.
Sure it does, I'm not a "New Programmer" so I guess I can't help him.
led mike
|
|
|
|
|
lee.hallows wrote: i'm getting an error when compiling and running my program
The error you gave is a runtime error. The compilation was successful. It also helps if you give an indication of where the error occurred. I'm guessing it is this line:
Bitmap background = new Bitmap(GetType(), "background.jpg");
lee.hallows wrote: Resource 'background.jpg' cannot be found in class 'Game.Form1'.
Have you added the "background.jpg" file as a resource? Are you sure you have used the correct name? If you think you have you might want to download Lutz Roeder's Reflector and examine the assembly.
|
|
|
|
|
If you added the image/bitmap to your project resource file,
and for instans you rename it to "myBackground"
you should be able to access it like this:
Bitmap bm = Properties.Resources.myBackground;
|
|
|
|
|
Hi,
I have two DataSets, one is connected using OleDbDataAdapter, and the other is connected using SqlDataAdapter. I would like to copy the data that i read from OleDbDataAdapter to SqlDataAdapter 'dadapter1'.
I tried to select the data from OleDbDataAdapter using "Select * from tb"
and keep the data in dataset1. And a create another SqlDataAdapter without any SQL statement. dataset2 is created for update purpose.
dataset2 = dataset1.Copy();
dadapter1.Update(dataset2,tbl2)
tbl2 is the table that can be found in dataset2.
Does anyone has any idea how to perform the dataset copying?
Many many thanks for your help
|
|
|
|
|
I would really want to look at the bigger picture here because I think you have the wrong end of the stick with regard to DataSets and DataAdapters.
savagerider wrote: I have two DataSets, one is connected using OleDbDataAdapter, and the other is connected using SqlDataAdapter.
DataSets are not connected to DataAdapters. They can be filled from them, but ultimately they are a disconnected data store.
|
|
|
|
|
Hi Colin,
Thanks for replying, actually my point is to copy the data from excel file to database. I know that we can use OleDbDataAdapter to read excel file data, but I'm wondering how could we actually copy the data into database using dataset.
Any idea?
|
|
|
|
|
how to write the values to xmlfile
i am getting the values into checkelistbox, but i want them to be saved to xml file,the nodes,attributes etc,
just suggest me the methodology
thnx and regards
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
System.Xml.Serialization
led mike
|
|
|
|
|
I have made a usercontrol that is basically a container with a nice looking header and an area for content. How do I add the usercontrol to another window and allow me to add other elements to the content area of the control? More specifically, I would like to be able to add the control to a window in blend double click it (change the insertion point) and add other controls as children of the usercontrol and they appear in the correct area. What do I need to do?
|
|
|
|
|
how can i change the default company name in visual studio?
|
|
|
|
|
I don't think you can set it manually. VS uses the system company that was entered when Windows was set up. Perhaps you can change Windows' stored company name, then VS should use that.
|
|
|
|
|
I didn't mean the VS company name, but the name on my projects (which is empty by default)
|
|
|
|
|
Yes, and VS uses the system company name for the default project company name, I believe.
|
|
|
|
|
Hi,
I have the regular expression for US phone number: "\(\d{3}\)\d{3}-\d{4}"
RegexOptions options = RegexOptions.None;
Regex regExpr = new Regex(@"\(\d{3}\)\d{3}-\d{4}.", options);
bool ret = regExpr.IsMatch(txtPhoneNumber.Text);
This boolean 'ret' value tell me whether entered number is in US phone format or not.
I want to "reformat" the entered phone number with respect to the expression.
Ex. if the user enters 1234567890, output should be 123-456-7890
Is there any way?
Thanks,
|
|
|
|
|
I don't really have an answer but I am also looking for similar information. Could you can use interop and just use the same logic that MS Outlook uses when entering a contact phone number? Otherwise, it would seem to me that you would have to build a custom parser.
|
|
|
|
|
The brackets in your regex create groups, you can then build a string using the groups and put the dashes in if you want to.
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 )
|
|
|
|