|
erm.... are you serious ?
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 )
|
|
|
|
|
I want my project to work but installing the tx textcontrol is not a solution for my problem.
I want to use only the .dll to make my program to work.
I don't want to install the tx textcontrol.
|
|
|
|
|
darkcalin wrote: I don't want to install the tx textcontrol.
Then why did you use it? Wasn't it obvious that by using a control outside of the .NET framework you would have to install that control with your project?
|
|
|
|
|
|
I have a COM component developed in C#. but we have to develop addin for MS Office by using this Component(DLL).
I develop a shared addin “MyFirstAddin” and try to add reference for that DLL which is already developed in C#
But I am getting errors message when i am trying to add reference like that
"A reference to 'C:/Helper.dll' could not be added. this is not a valid assembly or COM component etc"
so if anybody have idea where i am wrong please share with me.
thanks
|
|
|
|
|
hi,
I am using winultragrid control for display a records from a database.
I want to change active color of a selected row.
|
|
|
|
|
You will more likely find someone to help at the Infragistics Forums[^] because they specialise in that sort of thing. Here is just general C#
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Two ways of doing this:
1. Handle the AfterSelectChange event and use the grids ActiveRow.Appearance properties. e.g. Set the back color by calling. grid1.ActiveRow.Appearance.BackColor = Color.Blue;
2. Use the grids inbuilt design wizard - there is an "Appearance Browser" window where you can set an active rows appearance properties. This would be the best way to do it.
As mentioned by another post you should be able to get all the infragisitcs help you need from the infragistics forums or from the examples they provide with thier controls.
Goto the forums at: http://forums.infragistics.com/[^]
|
|
|
|
|
When I try to read a double value with the console.read method I get a completeley different value. In case of 0 I get 48, in case of 1 I get 49. I think these may be ASCII values. I also tried it with the convert.todouble method, but it didn't work. How can I get the correct values?
Thanks.
|
|
|
|
|
Yes they are ascii values. If you want to convert them to int just subtract 48
|
|
|
|
|
Subtracting an int from a float that's believed to be a int always returns an int, because ascii values are ints.
|
|
|
|
|
I guess it'd be better if you used Console.ReadLine() and then use float.TryParse() on the resulting string.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
float.TryParse() needs 2 arguments: at first the string that is wanted to be converted, and the second I think is the variable I want to give the resault to.
string s;<br />
double x;<br />
s = Console.ReadLine();<br />
float.TryParse(s,x);<br />
Console.Write(x);
The compiler reacts with two errors:
2-argument: can't be converted from "double" into "float"
method has illegal arguments
Thanks.
|
|
|
|
|
Hello,
For the first error the compiler says it all.
you have to use float instead of double or use double.TryParse.
Second error is, that the second parameter is an out parameter and has to be marked like that.
string s = "";
float x = 0;
s = Console.ReadLine();
if(float.TryParse(s, out x))
Console.Write(x.ToString());
Hope it helps!
All the best,
Noch einen schönen Tag,
Martin
-- modified at 11:48 Wednesday 4th July, 2007
|
|
|
|
|
The question is, why use Float.TryParse() is you're dealing with Ascii values?
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
i use usb-rs232 cable.and i have already install its driver.what must i do for using serialport in Windows Vista?i use visual studio 2005.must i download servispack?cause i have used XP,and same codes on C# was working.now what must i do?
|
|
|
|
|
I am a newbie, and I am starting to use the C# language, and I need a little help.
Here goes:
Main Form:
I put a textbox where card number should be inputted. When the user presses the Enter key it should look into the database (table) the value of the textbox.
Condition is:
If only one (1) item found, the information will be displayed on the Main Form other textboxes.
Otherwise if two or more items found, it will pass the card number to Form 2.
Form 2: will be shown if Main Form calls
Receive the card number passed by Main Form and search again the database (table) and display the items found on the datagridview. Then the user should select one (1) item, and pass back the single item with the complete (full) card number selected on the Main Form.
My questions:
How will I get the value of the current cell that I selected?
How will I pass back the value I selected to the Main Form?
How will Main Form receive the data being passed by Form 2?
Many thanks!
Form 1:
public partial class MRRMainForm : Form
{ // start partial class MRRMainForm
public String myConString = @"Provider=VFPOLEDB.1;" +
@"Data Source=" + D:\\MyMaintable.DBF";
public String cardNumber;
OleDbConnection con;
OleDbDataAdapter da;
OleDbCommand cmd = new OleDbCommand();
DataSet ds = new DataSet();
String commandSearch;
public MRRMainForm()
{
InitializeComponent();
}
private void txtCardNumber_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
{
// will trap other keys later..
//case Keys.
// break;
case Keys.Enter:
findCardNumber();
txtDescription.Focus();
break;
} // end switch
}
private void findCardNumber()
{
commandSearch = "Select * from MyMaintable where substr(prod_code,6,7)=\"" + txtCardNumber.Text + "\"";
con = new OleDbConnection(myConString);
cmd.CommandText = commandSearch;
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
da = new OleDbDataAdapter(cmd);
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows.Count > 1)
{
cardNumber = txtCardNumber.Text;
MultiplesFound myMF = new MultiplesFound(cardNumber);
myMF.myCardNumber = cardNumber;
myMF.ShowDialog();
}
else
{
txtProductCode.DataBindings.Add("text", ds.Tables[0], "prod_code");
txtDescription.DataBindings.Add("text", ds.Tables[0], "prod_desc");
txtModelNumber.DataBindings.Add("text", ds.Tables[0], "model_no");
}
}
else
{
MessageBox.Show("Not exist", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
} // end partial class MRRMainForm : Form
Form 2:
public partial class MultiplesFound : Form
{
public MultiplesFound(String myCard)
{
InitializeComponent();
}
public String myCardNumber;
private void MultiplesFound_Load(object sender, EventArgs e)
{
OleDbConnection con;
OleDbDataAdapter da;
OleDbCommand cmd = new OleDbCommand();
DataSet ds = new DataSet();
String commandSearch;
String myConString = @"Provider=VFPOLEDB.1;" +
@"Data Source=" + "D:\\ MyMaintable.DBF";
textBox1.Text = myCardNumber;
commandSearch = "Select * from MyMaintable where substr(prod_code,6,7)=\"" + myCardNumber + "\"";
con = new OleDbConnection(myConString);
cmd.CommandText = commandSearch;
cmd.Connection = con;
con.Open();
cmd.ExecuteNonQuery();
da = new OleDbDataAdapter(cmd);
da.Fill(ds);
dataGridView1.AutoGenerateColumns = false;
int newColIndex = dataGridView1.Columns.Add("prod_code","Code");
dataGridView1.Columns[newColIndex].DataPropertyName ="prod_code";
newColIndex = dataGridView1.Columns.Add("prod_desc","Description");
dataGridView1.Columns[newColIndex].DataPropertyName = "prod_desc";
newColIndex = dataGridView1.Columns.Add("model_no", "Model Number");
dataGridView1.Columns[newColIndex].DataPropertyName = "model_no";
dataGridView1.Columns["prod_code"].Frozen = true;
dataGridView1.DataSource = ds.Tables[0];
}
private void btnOK_Click(object sender, EventArgs e)
{
// I’m lost here!
}
private void dataGridView1_DoubleClick(object sender, EventArgs e)
{
// I’m lost here, either!
}
} //end class
BM
|
|
|
|
|
Maybe look at a public method on form2 as your entry point from form1, in that public method you use as the entry point use a ref variable that will enable you to use the variable in form2 and what ever you changed it to in form2 it will return that value back to form1.
He who laughs last is a bit on the slow side
|
|
|
|
|
1. For the first task, you can capture any suitable event of the
DataGridView in which you can get the content of the selected cell like
CellClick etc
2. To pass back the data to MainForm
There are many ways to do it. I choose the simplest one.
Create public properties in Second form and while closing this form, set the values of those properties with the selected values.
3. To get the data passed from form2
When the form2 closes, read the public properties created in step2
|
|
|
|
|
Just have the MultiplesFound form expose a public property indicating the row that was selected by the user.
<br />
if (ds.Tables[0].Rows.Count > 0)<br />
{<br />
int SelectedRow = 0;<br />
if (ds.Tables[0].Rows.Count > 1)<br />
{<br />
cardNumber = txtCardNumber.Text;<br />
MultiplesFound myMF = new MultiplesFound(cardNumber);<br />
myMF.myCardNumber = cardNumber;<br />
myMF.ShowDialog();<br />
SelectedRow = myMF.SelectedRow;<br />
}<br />
txtProductCode.DataBindings.Add("text", ds.Tables[SelectedRow], "prod_code");<br />
txtDescription.DataBindings.Add("text", ds.Tables[SelectedRow], "prod_desc");<br />
txtModelNumber.DataBindings.Add("text", ds.Tables[SelectedRow], "model_no");<br />
<br />
}<br />
Jeff Clark
Systems Architect
JP Clark, INC.
Columbus, Ohio
|
|
|
|
|
i getting this error message in my project
Control 'ctl00_cphContent_ctl00_grdReport' of type 'GridView' must be placed inside a form tag with runat=server.
Pls help me
kankeyan
|
|
|
|
|
What part of that don't you understand? Also, if you don't post your code, how are we supposed to tell you how to correct it?
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
protected void Page_PreRender(Object o, EventArgs e)
{
if (IsPostBack.Equals(false))
{
calFrom.SelectedDate = System.DateTime.Today;
calTo.SelectedDate = System.DateTime.Today;
}
}
protected void calFrom_SelectionChanged(object sender, EventArgs e)
{
blnCallFrom = true;
}
protected void calTo_SelectionChanged(object sender, EventArgs e)
{
blnCallTo = true;
}
protected void btnExcel_Click(object sender, EventArgs e)
{
// Set the content type to Excel
Response.ContentType = "application/vnd.ms-excel";
//Turn off the view state
this.EnableViewState = false;
//Remove the charset from the Content-Type header
Response.Charset = String.Empty;
Response.AddHeader("content-disposition", "attachment; filename=" + calFrom.SelectedDate.ToString("YYYYMMdd") + ".xls");
value is not posted in the calfrom date too
System.IO.StringWriter myTextWriter =new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter myHtmlTextWriter = new System.Web.UI.HtmlTextWriter(myTextWriter);
grdReport.RenderControl(myHtmlTextWriter);
error is coming here
//grdReport.RenderControl(myHtmlTextWriter);
//Write the HTML to the browser
Response.Write(myTextWriter.ToString());
//End the response
Response.End();
}
}
kankeyan
|
|
|
|
|
The problem is with the ASPX, not the CS file. Do what the compiler suggests, and if you stil face problems, post the relevant ASPX code. In the right forum.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
First This is an asp.net question so you should have posted it in the correct forum.
And regarding the error it states that the gridview control has to be inside the form control which should have runat=server attributes.
Apurva Kaushal
|
|
|
|