|
-
http://xmlia.com
Date: 03/20/07
Keywords: xml, web
Dear friends! We are glad to you to inform on opening new, absolutely free-of-charge site about online XML-validator and web-based editor.
For what to pay huge money for different win-based editors or to put the unchecked cracked copies? Use our site, and you should not install anything on computer. Our site does not contain advertising, is quickly loaded,consumes not enough traffic and quickly processes your data. At your service XML visualisation not only in the form of TREE, but also in the form of GRID, that is actually avaliable only in very expensive windows XML editors.
all what you need to do-its just register for free
See you in http://xmlia.com
Source: http://community.livejournal.com/csharp/82572.html
-
Help my regressing (ADO + MS Access)
Date: 03/19/07
Keywords: database, sql
Hello! I've got a problem. I was sent to another part of my plant and there is no networking between some offices. So I had to make my database local and keep it in MS Access. But as I used to create applications in c# ( using SQL Server 2000) you can imagine what i feel... I faced the problem of multisearching ( search by different parameters up to 25 and we don't know exact quantity of them). I didn't have such problems yet ( cause i got stored procedures on my server) and i didn't care for the quantity of parameters (fields for search). But now... How to organize multisearching if my database is storing in Access?
In short, could you help me with any information..As I feel
Thanks beforehand
Source: http://community.livejournal.com/csharp/82235.html
-
MultiSampleQualityLevel?
Date: 02/17/07
Keywords: no keywords
Sorry for asking here, but there don't seem to be any XNA groups that I can find yet.
C# 2005 Express Edition. I choose File::New Project and start a new Windows Game (XNA) project. Try to build and run before adding any code whatsoever and get an InnerException in Game1.Desiogner.cs. Digging down a little in the exception box gives me this message:
"he selected MultiSampleQualityLevel is invalid for the selected MultiSample type."
I've found MultiSample in GraphicsComponent(), but I can't seem to find any way to set MultiSampleQualityLevel, as it's a provate mamber variable. Googling and MSN live search have proven to be no help whatsoever.
Anyone seen this before? Know how to fix it? Thanks.
Source: http://community.livejournal.com/csharp/81791.html
-
I really need help :(
Date: 02/13/07
Keywords: no keywords
Okay..
I have 3 files: tank.cs, fish.cs and yellowtail.cs
yellowtail is derived from the abstract class fish, tank is the 'container' for yellowtail.
fish contains a constant int: const int HEIGHT = 30;
fish contains a get/set property for HEIGHT: public int Height { get { return HEIGHT; } set { Height = value; } }
yellowtail overrides the constant int from fish: const int HEIGHT = 50;
What I want to do is to be able to go into the tank class and call something like yellowtail.Height and have it bring that value of 50 with it.
Thank You!
Source: http://community.livejournal.com/csharp/81602.html
-
getch() in C#
Date: 02/10/07
Keywords: no keywords
Is there anything wrong with the following to emulate getch() (aside from not handling exceptions) using .NET 2.0?
using System;
public class Input
{
static void Main(string[] args)
{
char ch = getch();
Console.WriteLine("You entered: {0}", ch);
}
static char getch()
{
ConsoleKeyInfo cki = Console.ReadKey(true);
return cki.KeyChar;
}
}
Source: http://community.livejournal.com/csharp/81275.html
-
treeview control and onHover event
Date: 02/02/07
Keywords: no keywords
Anyone out there actually been able to make the onHover event work with the 2.0 treeview control? We are in a research phase right now and I could really use some feedback. Thanks
Source: http://community.livejournal.com/csharp/81067.html
-
What Would a SQL Programmer Do?
Date: 01/27/07
Keywords: no keywords
Accessing in-memory data by index
Source: http://community.livejournal.com/csharp/80687.html
-
Sending a Memory Stream
Date: 01/19/07
Keywords: html
I'm trying to send an email attachment "Data.txt" which in the end, is a tab-delimited file. I want to do this without creating a file on the server, so I'm reading the data in to a memory stream, and sending it across. The problem is that when the email arrives, the file itself is empty. Here is my sample code:
private void SendEmail() { try { string strEmailFrom = txtFrom.Text; string strEmailT0 = txtTo.Text;
string strSubject = "Email test";
MemoryStream msData = new MemoryStream(); TextWriter twReport = new StreamWriter(msData); for (int r = 0; r < 10; r++) { for (int c = 0; c < 10; c++) { string sValue = "r=" + r.ToString() + ";c=" + c.ToString(); twReport.Write(sValue); twReport.Write("\t"); } twReport.Write(System.Environment.NewLine); }
string strBody = "Email Test Body";
twReport.Flush(); SendEmailDirect(strEmailFrom, strEmailT0, strSubject, strBody, msData, "ReportDataEmail.txt", true);
twReport.Close(); } catch (Exception e) { MessageBox.Show(e.ToString()); } }
public static void SendEmailDirect(string strEmailFrom, string strEmailTo, string strSubject, string strBody, System.IO.Stream streamData, string strAttName, bool bIsHtml) {
SmtpClient oSmtpClient = new SmtpClient(GetSMTPClient()); MailMessage mailMessage = new MailMessage(); mailMessage.IsBodyHtml = bIsHtml;
mailMessage.To.Add(strEmailTo); mailMessage.From = new MailAddress(strEmailFrom); mailMessage.Subject = strSubject; mailMessage.Body = strBody;
System.Net.Mime.ContentType ct = new System.Net.Mime.ContentType(); ct.MediaType = System.Net.Mime.MediaTypeNames.Text.Plain; ct.Name = strAttName;
Attachment attReport = new Attachment(streamData, ct);
mailMessage.Attachments.Add(attReport);
oSmtpClient.Send(mailMessage); }
What am I doing wrong?
Source: http://community.livejournal.com/csharp/80618.html
-
drag and drop outlook contacts
Date: 01/08/07
Keywords: microsoft
I am trying to drag and drop an outlook contact into a form. No matter what I do it sees it as text. I am trying to make it work so the contact is dropped and the various objects within the contact (FullName, BusinessAddress, etc.) can then be assigned to a string and populate the form. I can grab the whole thing as one string and plonk that in a field but that really isn't much use. Using an array gets the same useless effect.
I know there are usually only a few types GetData knows how to work with (eg. text, gif, etc.) do I need to define a custom format using Microsoft.Office.Interop.Outlook.ContactItemClass ? Is there someway I can make it see what it is?
Source: http://community.livejournal.com/csharp/80210.html
-
PictureBox and the classified scaling factor
Date: 01/04/07
Keywords: no keywords
Alright, this is beyond asinine.
I'm writing a program to allow someone to look at a CMYK image in our company's format. That part was, ironically, the easy part. I construct an RGB bitmap that Windows can actually deal with, and put it in a PictureBox. The PictureBox, set to Zoom mode, resizes the bitmap and does a best-fit to make it as large as possible within the viewable area.
However, what I need to be able to do now is let the user select a portion of the image, and make a bitmap of that. Obviously, I could crop and resize part of the bitmap I've already created, but I need to go back to the source CMYK image and rebuild a preview, because, over multiple crops, the image would be constantly scaled, and would start to look terrible.
Does anyone know of anyway to get the actual (that is, drawn) position and size of an image in a PictureBox?
DC
Source: http://community.livejournal.com/csharp/80046.html
-
MAC discovering
Date: 12/22/06
Keywords: no keywords
Any idea how to discover local LAN adapter's MAC ( hardware ) address ?
Or any suggestions about LAN adapter's enumeration ?
Found System.Net.NetworkConfiguration searching the inet, but include causes "unresolved namespace".
Source: http://community.livejournal.com/csharp/79690.html
-
Updating multiple rows in sql
Date: 12/04/06
Keywords: sql
I am trying to update multiple rows and multiple fields in sql using an update statement. So far I can't find a good way to do this. I've looked at using SQLBulkCopy object, but apparently that only works for inserts. I can open the connection, write all the separate update queries, then execute them, but this will take forever, almost as slow as updating the rows one by one. The schema of my datatable is different than that of the destination table. So it looks like its going to be a for loop making updates unless someone knows of a better way... thanks!
Source: http://community.livejournal.com/csharp/79016.html
-
Query Analyzer Vs. SRS... different results
Date: 10/19/06
Keywords: database, sql
So, I'm posting here in hopes that someone has encountered something like this before and knows a way to fix it.
this is a larger issue, but the crux of it is simply this query (yes it calles a sql server stored proc):
spRPT_TKT_ThreeDayCountReport null,null,null,null,null,null,'9/16/2006','10/15/2006',null,null,null,null,null,null,null,null,null
When executed from query analyzer (paste in, hit f5) connected to the production database I get one set of results. When executed as a dataset (command type: text) in Sql Reporting Services, I get a different set of results.
The row counts and MOST of the associated data are exactly the same, the problem lies in SOME of the individual items are 0 (not null, just 0), in all cases these are sum(isnull(-variable-),0) items in the Sproc.
I am at a loss for why the results to this query are different from one application to the other. (and they are 100% reproducable).
any ideas?
Source: http://community.livejournal.com/csharp/78075.html
-
Old-school databinding and DataMembers
Date: 10/19/06
Keywords: database, sql, web, microsoft
Yes, I'm back.
private string ConnectionString;
private DataViewManager dsView;
private DataViewManager dsViewHospitals;
private DataSet ds;
public TestHospitalFormGrid()
{
InitializeComponent();
ConnectionString = "data source=edison;uid=sa;password=nothing;database=hospratestest";
SqlConnection cn = new SqlConnection(ConnectionString);
//Create the DataSet
ds = new DataSet("HospRates");
//Fill the dataset with hospitals
SqlDataAdapter da1 = new SqlDataAdapter("select * from hospitals", cn);
da1.TableMappings.Add("Table", "Hospitals");
da1.Fill(ds, "Hospitals");
//Fill the dataset with rates
SqlDataAdapter da2 = new SqlDataAdapter("select * from CombinedRateData", cn);
da2.TableMappings.Add("Table", "Rates");
da2.Fill(ds, "Rates");
//tables father back will go here later
//Establish relatinship between hospitals and rates
DataRelation relHospRates;
DataColumn MasterColumn;
DataColumn DetailColumn;
MasterColumn = ds.Tables["Hospitals"].Columns["ID"];
DetailColumn = ds.Tables["Rates"].Columns["prov_id"];
relHospRates = new DataRelation("HospRatesRelation", MasterColumn, DetailColumn);
ds.Relations.Add(relHospRates);
dsView = ds.DefaultViewManager;
dsViewHospitals = ???;
dgDetail.DataSource = dsView;
dgDetail.DataMember = "Rates.HospRatesRelation";
//dgDetail.DataSource = "Rates.HospRatesRelation";
cboName.DataSource = dsView;
cboName.DisplayMember = "Hospitals.Name";
cboName.ValueMember = "Hospitals.ID";
}
}
This code generates an error. After two hours of looking around the web, I finally got pointed to this KB article, which tells me my problem stems from the fact that my DataMember has a period in it, and that this bug is considered a "feature" by Microsoft. As you can see, I have tried setting the datasource directly to the relation; this results in the form loading and the datagrid remaining empty no matter what I do.
I need to find a way to set the datasource of the datagrid to the relation in question. It seems to me that the easiest way to do this will be to set the view dsViewHospitals to only show the relation in the dataset, but I'm not finding any code samples for how to set view to anything other than DefaultViewManager programmatically at Microsoft. How would I go about doing such a thing? Thanks.
Source: http://community.livejournal.com/csharp/77639.html
-
If you'd develop a freeware program for .Net platform...
Date: 10/18/06
Keywords: no keywords
I can make an advertise of your product for you in my .Net magazine (only in russian) for free. For more details contact me hdrummer at gmail.com
Source: http://community.livejournal.com/csharp/77483.html
-
Adding an Event Handler in VS.NET 2005
Date: 10/14/06
Keywords: no keywords
This is a very stupid issue.
Project: Windows Forms project on C#.
Problem: Form1_Resize() event is not in the list, and I can't find a proper way to add it.
Please help. :)
Source: http://community.livejournal.com/csharp/77251.html
-
Combobox Selected Index Changed event
Date: 10/13/06
Keywords: database, sql
Yes, I'm beating my same dead horse, of course. Now, I'm really confused. But at least my confusion is limited to a single control this time. C# 2005 standard, Windows XP Pro, tied to a SQL Server 2000 database.
I have a control on a winform called cboName. Is is bound to a bindingsource called bsHosp, which goes back to a table called Hospitals. The bindingsource has a sort on it by name ascending, so everything in this box is in alphabetical order. Where I'm running into severe confusion is in the SelectedIndexChanged event (which has been the cause of all my woes over the past two weeks). The bindings on the combobox: SelectedItem: bsHosp.Name SelectedValue: bsHosp.ProvNo Tag: (none) Text: bsHosp.Name
(ProvNo and Prov_ID
In order to test the screwy databinding (check a few messages back in this community for a description), I put in a messagebox to check that the filter and sort on the other bindingsource were actually being changed. Here's the code for the SIC event:
private void cboName_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
bsRate.Filter = "prov_id = " + txtProvNo.Text;
bsRate.Sort = "mexp desc";
bsRate.ResetBindings(false);
MessageBox.Show("Filter = " + bsRate.Filter.ToString() + " Sort = " + bsRate.Sort.ToString());
}
catch (Exception ex)
{
}
finally
{
}
}
(It's in the try block to prevent the program from throwing an exception when the form is closed.)
Now, to show you what it's doing, I actually have to show you a piece of the table itself. Like I said, this is right weird.
68267 Adams County Hospital 62578 Bellevue Hospital 4628 Belmont Pines Hospital
Adams, being the first one on the list, is what pops in by default. Each of these contains one entry in the table.
When I try to switch to Bellevue Hospital, this is what happens:
1. Messagebox shows prov_id 68267, combobox shows Adams County Hospital. 2. Messagebox shows prov_id 68267, combobox shows Bellevue Hospital. 3. Messagebox shows prov_id 68267, combobox is blank. 4. Messagebox shows prov_id 62578, combobox shows Belmont Pines Hospital. 5. Messagebox shows prov_id 62578, combobox is blank. 6. Messagebox shows prov_id 4628, combobox shows Belmont Pines Hospital. 7. When I check the dropdown list in the combobox again, Adams County Hospital has disappeared and Bellevue Hospital is in the dropdown list twice. There is no change to the underlying table.
I assume this behavior is not normal, especially since I'm not even getting the name I'm selecting in the textbox. Has anyone seen anything like this, and can you tell me why it's happening? And, preferably, how to fix it?
* * *
Variations:
1. When I put the MessageBox command in the finally clause instead of the try clause, I get the same result. 2. When I take out the try/catch clause altogether, again, the same thing happens. 3. It makes no difference whether the ResetBindings command is commented out or not.
Thanks.
Source: http://community.livejournal.com/csharp/76871.html
-
In an attempt to reinvent the wheel...
Date: 09/26/06
Keywords: web, microsoft, google
...my brain has decided that it can't remember what a circle is. Worse yet, the internet has no definition for "circle," or else my ability to use google search has terribly degraded.
Two intensely, incredibly stupid questions, for which I apologize profusely before we even begin. Both refer to a winform* I have to rebuild thanks to an executive-level decision to change the structure of its underlying table. This winform has a large number of databound controls, all of which tie to one bindingsource and its tableadapter. (This, BTW, is in VS 2005 Standard.)
* i.e., "winform" as opposed to "webform".
1. Two of the controls ar DateTimePickers, dtpEffective and dtpExpiration. All of the other simple controls are changing every time the value of the "main" control (cboName) is changed, but I cannot for the life of me figure out the correct property to set to get the DTPs to change from their default values of '1/1/1900' and '[insert current date here]'. Presently, both Text and Value are set to be bound to the table column that contains the date in question; I have tried it with just Text and just Value bound, and have gotten similar results with each of those options. What's the obvious binding I'm missing to get the DTPs to change with everything else?
2. One of the simple controls is txtID (not surprisingly, a text box containing an ID number). The complex control-- there's only one-- is a datagridview, dgRates. At present, dgRates vomits up the entire CombinedRateData table when the form runs. This makes sense, because I have not incorporated a WHERE clause into the Fill() query. Here's brainfart #2: I can't remember how to turn "txtID.Text" into a parameter that the query will understand, because I am entirely too sleepy, and every time I search for this on the web, I end up back at Microsoft's "How to create a master/detail form using two datagridviews" walkthrough. (Which is cool, but not applicable.)
Thank you, and again, you have my humble apologies for consulting you on such trivial matters. My brain has just decided to switch itself off this afternoon, and I can't kick it back into gear.
Source: http://community.livejournal.com/csharp/76120.html
-
JetBrains dotTrace 2.0 beta released
Date: 09/15/06
Keywords: software, html, asp, microsoft
The public beta version of the best profiler for .NET applications was released today.
You can download it and and try out here: http://www.jetbrains.com/profiler/beta.html. The download includes a full-functionality license that will allow you to use the software until October 31, 2006.
The most important new feature in dotTrace 2.0 beta is Memory Profiling. Now you can see what happens with the memory used by your .NET applications to optimize how your app uses memory. You can capture snapshots of memory to analyze in nine informative views, each tuned to a specific aspect of memory usage. You can also take a snapshot of the application’s memory state at two key points to compare them and locate memory leaks.
Notable enhancements in performance profiling include "Quick Info" for any function, the ability to compare performance snapshots of the same application, new filtering options and collapsing recursive calls. Among other useful features and improvements are the integration with Microsoft Visual Studio and the ability to profile Windows services.
Information on new features is available at http://www.jetbrains.com/profiler/features/newfeatures.html.
We think you’ll find that dotTrace 2.0 is now a comprehensive and robust profiling solution for .NET applications that stands up to the most demanding profiling requirements. Give it a try and let us know what you think!
Source: http://community.livejournal.com/csharp/75876.html
-
Getting a value out of stored procedure.
Date: 09/06/06
Keywords: sql
Hi guys, me again.
Here's a stored procedure procedure
[SqlProcedure] public static void GetLastAddressId() { string sqlString = "SELECT MAX(ADRID) FROM dbo.tblAddress";
SqlPipe sp = SqlContext.Pipe; using (SqlConnection conn = new SqlConnection("context connection=true")) { conn.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.Text; cmd.Connection = conn; cmd.CommandText = sqlString; string rdr = cmd.ExecuteScalar().ToString(); sp.Send(rdr); } }
Then, there is a TableAdapter with query which is set to return a Single Value.
Then, here is a place where I use that TableAdapter to get that maximum Id (inside some class):
public static string getLastAddressId() { DALTableAdapters.QueriesTableAdapter fs = new DALTableAdapters.QueriesTableAdapter();
return (fs.GetLastAddressId()).ToString(); }
Why does the last line (the "return" line) give me an exception, saying that the referenced object doesn't exist? I'm sure I did something wrong with the stored procedure, as I never figured out how to send values like that from stored procedure to my program. Please, help.
Source: http://community.livejournal.com/csharp/75471.html
|