|
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 )
|
|
|
|
|
Maybe the Masked textbox can help you?
|
|
|
|
|
how to connect a modem with c#.
i want a telephone bill payment program. when i dial a number, my program will replay the current bill via telephone . how can i connect a modem to c#. hve any third party controls
sree
|
|
|
|
|
Use class SerialPort to connect with the modem.
Then you must read the manual from the modem to send
the appropriate command, for example "ATDT12345" to dial
a number.
|
|
|
|
|
I have two DataTables (orders and orderitems) in my DataSet that use DataRelation on orderid. I am trying to create a third DataTable that will hold the result but I am having a lot of trouble doing this so that the code doesn't care what columns were selected. I have the columns of the new DataTable being created fine but how do you mix parent rows and child rows into a single DataRow?
Thanks for any help!
DataSet theDataSet = new DataSet();
//get orders
SqlCommand ordersCommand = new SqlCommand("select * from uc_orders where order_date > '03/01/2007'", theconn);
theadapter.SelectCommand = ordersCommand;
DataTable ordersDataTable = new DataTable("Orders");
theadapter.Fill(ordersDataTable);
//orderitems
SqlCommand orderItemsCommand = new SqlCommand("select * from uc_order_items where load_date > '03/01/2007'", theconn);
theadapter.SelectCommand = orderItemsCommand;
DataTable orderItemsDataTable = new DataTable("OrderItems");
theadapter.Fill(orderItemsDataTable);
//add both tables to dataset
theDataSet.Tables.Add(ordersDataTable);
theDataSet.Tables.Add(orderItemsDataTable);
//create a "join" called OrdersRelationship on order_id
theDataSet.Relations.Add(new DataRelation("OrdersRelationship", ordersDataTable.Columns[keyColumn], orderItemsDataTable.Columns[keyColumn], true));
//new table
DataTable ordersAndOrderItems = new DataTable();
//loop over all available columns in each table
foreach (DataColumn dc in ordersDataTable.Columns)
{
ordersAndOrderItems.Columns.Add(dc.ColumnName);
}
foreach (DataColumn dc in orderItemsDataTable.Columns)
{
if (!ordersAndOrderItems.Columns.Contains(dc.ColumnName))
ordersAndOrderItems.Columns.Add(dc.ColumnName);
}
theDataSet.Tables.Add(ordersAndOrderItems);
//parent loop, get child
foreach (DataRow parentRows in ordersDataTable.Rows)
{
DataRow[] childRow = parentRows.GetChildRows("OrdersRelationship");
foreach (DataRow allChildren in childRow)
{
????????????
//hardcoded answer
ordersAndOrderItems.Rows.Add(allChildren["order_id"], parentRows["order_id"], allChildren["store_items_id"], parentRows["last_name"]);
}
}
|
|
|
|
|
I solved it by adding the parent columns to the child DataTable and then filling it with data.
//create a "join" called OrdersRelationship on order_id
theDataSet.Relations.Add(new DataRelation("OrdersRelationship", ordersDataTable.Columns[keyColumn], orderItemsDataTable.Columns[keyColumn], true));
//add parent columns to child DataTable
foreach (DataColumn dc in ordersDataTable.Columns)
{
if (!orderItemsDataTable.Columns.Contains(dc.ColumnName))
orderItemsDataTable.Columns.Add(dc.ColumnName);
}
//add parent data to child DataTable
foreach (DataRow dc in orderItemsDataTable.Rows)
{
foreach (DataColumn pdc in ordersDataTable.Columns)
{
if (pdc.ColumnName != keyColumn)
dc[pdc.ColumnName] = ordersDataTable.Rows.Find(dc[keyColumn])[pdc];
}
}
|
|
|
|
|
I'm using the TcpClient(hostname,port) to retreive my emails, When the port is 110 and is not using a secure connection, i'm successful getting my email, however when I try to read my Gmail account the Tcp,Client just hangs there and there is no option to use the secure connection, how can I make this program connect to my gmail account?
|
|
|
|
|
Hi
You can use SecLib from Mentalis.Org to establish an SSL - Connection.
If you're looking for a Library that supports ssl check http://www.codeproject.com/cs/internet/pop_-_class.asp[^] it's going to be updated soon and the new version supports ssl
if you use the framework 2.x, there's a built-in library that supports almost the same things as the mentalis library does for the 1.x framework
greets
m@u
-- modified at 10:47 Wednesday 14th March, 2007
|
|
|
|