|
Hai every body,
Warm Greetings!
I want to maintain different cultures for different users who is browsing my page.
I tried this with the web.config file but this will change it globally.
Then I tried by setting the culture information in the Session and then I call it in the each page.
Let me know, is there any other solution available instead of the above.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hello!
I´m having a problem with an application. This app has two windows, one as main view, one for entering some value that pops up when the value is needed.
Sometime it happens that another application fetches the window-focus and so theres no focus on my input window. In order to see that i made the inputbox change it´s color. I´m using the "deactivate"-event to do this.
Unfortunately this doesn´t work always. Does anybody have any idea why this could be so?
|
|
|
|
|
Would you please suggest me taht how to process large .csv files(more than 1000 lines) FASTER, so that it can be processed faster by XML Processor to convert into xml files.
But it works with small file(less than 1000 lines). But incase of large .csv files it gives following Memory Managament Error.
"Your system is low on virtual memory.Windows is increasing the size of the virtual memory paging file...."
or
Can anyone help me to split above large file(more than 15MB) to smaller files(5MB each), so that the above processing can be continued smoothly.
Please solve my problem with the code in C#.NET
With Regards
Tapan
|
|
|
|
|
Is it possible to dynamically add Items (like adding 50 drop down boxes in Property grid) at runtime ? How can I do it ?
Rajan
|
|
|
|
|
Yes you should be able to so that i think check various properties of datagrid
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Sandeep,
Thanks for your reply. But I am looking to add fields, items (like adding dropr down boxes)dynamically in a property grid and not in data grid.
If you have any solution can you please let me know ?
This property grid I created by
PropertyGrid PlanningPropertyGrid = new PropertyGrid();
Thanks or your help !
Rajan
|
|
|
|
|
Hello Rajan,
Smart PropertyGrid.Net is the perfect candidate to let you add properties at runtime. It could be in a loop, you call AppendProperty, set its look and the inplace control it must use, and voila!
|
|
|
|
|
Hi Everyone,
Just trying to learn C# and I've tried to add a simple multi-dimensional array to a datagridview control.
What is a very simple way to add the following array to a datagridview?
string[,] hosts =
{
{"www.yahoo.com","UNKNOWN"}, {"houapps007v","UNKNOWN"}
};
Thanks!
|
|
|
|
|
Did you figure this out, I need to do the same. I was just reading about binding sources and changing the data source property and it will automtically change the data in the grid.
Michael
|
|
|
|
|
how to pass the value for the parameter for the crystal report from the main form
|
|
|
|
|
client request :
they need save the report everday, so we must generate static report ,
How can i do that?
can you give me a demo code, not microsoft one , because I tried it failed
thank you!
|
|
|
|
|
hi all.
is there a way to do a message count down counter?
so that whenever a user types the maximum of 160 characters, the program will detect it and a message box will appear.
thanks.
|
|
|
|
|
If you are using a textbox say txtName then you can write an event handler for KeyPressed event. Like....
<br />
private void txtUname_KeyPress(object sender, KeyPressEventArgs e)<br />
{<br />
if (txtUname.Text.Length == 160)<br />
{<br />
MessageBox.Show("Text5");<br />
}<br />
}<br />
Hopefully it will solve your problem.
Mujtaba
"If both of us are having one apple each and we exchange it, at the end we both will have one apple each. BUT if both of us are having one idea each and we exchange it, at the end both of us will be having two ideas each."
|
|
|
|
|
thanks.
|
|
|
|
|
I am trying to load up a dataset from an SQL table, after the first row the code is exited at the following line:
dr = dt.NewRow();
There are 10,000 lines in the SQL table do you have any ideas on why this is happening.
DataSet_I.BSDDataTable BSD = new DataSet_I.BSDDataTable();
if (strTableName == "xxxxx")
{
dt = BSD;
if (Rowset != null && Rowset.IsOpen)
{
int nCol = 0;
//int nCols = Rowset.Cols;
Rowset.MoveFirst();
while (!Rowset.IsEOF)
{
dr = dt.NewRow(); **************EXITS CODE on 2nd PASS******************
foreach (DataColumn dc in dt.Columns)
{
nCol++;
object dcValue = Rowset.GetData(nCol);
if (dcValue != null)
{
if (dc.DataType == typeof(System.String))
dr[dc] = (string)Rowset.GetData(nCol);
else if (dc.DataType == typeof(System.Int32))
dr[dc] = (int)Rowset.GetData(nCol);
else if (dc.DataType == typeof(System.Single))
dr[dc] = (float)Rowset.GetData(nCol);
else if (dc.DataType == typeof(System.DateTime))
dr[dc] = (DateTime)Rowset.GetData(nCol);
}
}
dt.Rows.Add(dr);
Rowset.MoveNext();
}
}
Also, can I assign a set number of rows to the DataTable before I start and just load without adding new rows.
Any help would be greatly appreciated.
Thanks in advance.
Michael
|
|
|
|
|
Is there any exception? If yes then what is the exception message?
Mujtaba
"If both of us are having one apple each and we exchange it, at the end we both will have one apple each. BUT if both of us are having one idea each and we exchange it, at the end both of us will be having two ideas each."
|
|
|
|
|
There is no exception message is just continues on to the next table (I am trying to load multiple tables).
Michael
|
|
|
|
|
Hi there,
I am using this stored procedure in sql.
I have 6 tables. One is called employees. This is what I need to be able to do. A user enters a new employee into a winform, picks a role, division, manager, technicalskill set and applications from the drop down lists and hits save. The employee table should be the only one updated and has these columns only.( firstname, lastname, dvisionid, managerid, roleid,techskillsid, and appID). At the moment what is happening is its saving the firstname, lastname correctly, but the rest of the ID columns are null. It is updating the other tables with the string entered but what I need is the emplyee table to update with the corresponding ids. Is this alot more complicated then i thought? If I try to replace the role with roleid etc, it will just tell me I can't convert string to int which is understandable. How do I do this?
CREATE PROCEDURE sp_InsertEmployee
@Firstname nvarchar(50),
@Lastname nvarchar(50),
@Role nvarchar(50),
@Manager nvarchar(50),
@Division nvarchar(50)
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO EMPLOYEES (FIRSTNAME, LASTNAME) VALUES (@FIRSTNAME, @LASTNAME)
INSERT INTO [ROLE] ([ROLE]) VALUES (@ROLE)
INSERT INTO MANAGER (MANAGER) VALUES (@MANAGER)
INSERT INTO DIVISION (DIVISION) VALUES (@DIVISION)
END
GO
My C# code is like this:
SqlCommand sqlC = new SqlCommand("sp_InsertEmployee", myConnection);
sqlC.CommandType = CommandType.StoredProcedure;
sqlC.Parameters.Add(new SqlParameter("@Firstname", SqlDbType.VarChar, 50, "Firstname"));
sqlC.Parameters.Add(new SqlParameter("@Lastname", SqlDbType.VarChar, 50, "Lastname"));
sqlC.Parameters.Add(new SqlParameter("@RoleID", SqlDbType.Int, 50, "RoleID"));
sqlC.Parameters.Add(new SqlParameter("@ManagerID", SqlDbType.Int, 50, "ManagerID"));
sqlC.Parameters.Add(new SqlParameter("@DivisionID", SqlDbType.Int, 50, "DivisionID"));
//sqlC.Parameters[0].Value = 4;
sqlC.Parameters[0].Value = FirstnameText.Text;
sqlC.Parameters[1].Value = Lastnametext.Text;
sqlC.Parameters[2].Value = RolecomboBoxTest.Text;
sqlC.Parameters[3].Value = ManagercomboBox1.Text;
sqlC.Parameters[4].Value = DivisioncomboBox2.Text;
int i = sqlC.ExecuteNonQuery();
//sqlC.ExecuteNonQuery();
Sorry for pasting so much.
|
|
|
|
|
Actually, this is an easy question, about converting formats. int.TryParse is how you get an int out of a string.
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 )
|
|
|
|
|
falles01 wrote: At the moment what is happening is its saving the firstname, lastname correctly, but the rest of the ID columns are null.
Of course they are. You don't specify any values for them.
falles01 wrote: It is updating the other tables with the string entered but what I need is the emplyee table to update with the corresponding ids. Is this alot more complicated then i thought?
As you obviously thought that it would happen automatically, yes, it's a lot more complicated than that.
You have to add the other values first, and get the id that is created for each record:
declare @RoleId int<br />
insert into [ROLE] ([ROLE]) values (@ROLE)<br />
set @RoleId = scope_identity()
Then you can use these values when you insert into EMPLOYEES.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thank you, but I decided to just use my insert statement for now as that works.
My question now is how exactly do I get selected values of a checkedlist box and store it as ID numbers in the database. I had something like this which is obviously wrong. It works for the comboboxes but then I heard you need for loops to check multiple selections in a checkedlistbox. Feel free to just change my code.
if (this.techSkillsCheckListBox2.CheckedItems.Count > 0)
{
label1.Text = "worked";
foreach (string item in this.techSkillsCheckListBox2.CheckedItems)
{
string sql = "INSERT INTO employees(Firstname,Lastname,RoleID,DivisionID,ManagerID,TechnicalSkillsID) Values ('" + FirstnameText.Text.ToString() + "' , '" + Lastnametext.Text.ToString() + "' , " + RolecomboBoxTest.SelectedValue.ToString() + "," + DivisioncomboBox2.SelectedValue.ToString() + " , " + ManagercomboBox1.SelectedValue.ToString() + " , " + techSkillsCheckListBox2.SelectedValue.ToString() + ")";
Don't worry this won't be used commercially so I was told not to worry about injection attacks until I can get these correct.
Thank you for helping out.
|
|
|
|
|
falles01 wrote: It works for the comboboxes but then I heard you need for loops to check multiple selections in a checkedlistbox.
If you have a control that allows mutiple selections, then you have to use the SelectedItems property instead.
You also have to change your database design so that it allows for multiple values.
---
single minded; short sighted; long gone;
|
|
|
|
|
It doesn't allow multiple selections though. Okay well apart from the database side of things I believe I have to use a 'for' loop.
why does the following return an error?: The name 'Checked' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
foreach (int indexChecked in techSkillsCheckListBox2.CheckedIndices)
{
string sql = "INSERT INTO employees(Firstname,Lastname,RoleID,DivisionID,ManagerID,TechnicalSkillsID) Values ('" + FirstnameText.Text.ToString() + "' , '" + Lastnametext.Text.ToString() + "' , " + RolecomboBoxTest.SelectedValue.ToString() + "," + DivisioncomboBox2.SelectedValue.ToString() + " , " + ManagercomboBox1.SelectedValue.ToString() + " , " + techSkillsCheckListBox2.GetItemCheckState(indexChecked).ToString() + ")";
SqlCommand sqlC = new SqlCommand(sql, myConnection);
}
}
Anyone. I have been baffled by this for 8 hours. Its especially annoying when it was so easy to work out the combobox selections.
Thanks again.
|
|
|
|
|
Hey all,
I was looking for a way to iterate through all properties for a given control, but am only finding ways to access individual properties.
I am generating lists of all controls on a target form, but would also like to list all properties for each.
Regards.
-- modified at 18:48 Sunday 2nd September, 2007
|
|
|
|
|
ushering wrote: I am generating lists of all controls on a target form, but would also like to list all properties for each.
Use reflection. See the documentation for the System.Reflection namespace
Off the top of my head something like this will get you all the properties on a class (not just controls, any class)
Type controlType = myControl.GetType();
PropertyInfo[] properties = controlType.GetProperties();
DISCLAIMER: This is as I remember it, I haven't checked that the real methods are exactly as stated.
|
|
|
|
|