|
Abhijit Jana wrote: Because in textbox , it contain same property for all chartacter as NotePad,
What do you mean ?
|
|
|
|
|
What ever font or color or font style you apply to a Notepad it will be same
for conatin of that file, you cant use multiple color to differ character in Notepad
and this is the concept of TextBox.
If you thing about wordpad , it has same features of RichTextBox, as you can apply multiple color
style for differt line etc...
Please Correct me if I am wrong !!!
Thanks
|
|
|
|
|
Abhijit Jana wrote: you cant use multiple color to differ character in Notepad
and this is the concept of TextBox.
Ohh you mean that. It was not giving clear idea, Yes you are correct, a normal textbox is used for showing/entering plain text.
|
|
|
|
|
Could any one please tell me how to insert multiple values into a single column i want structure something like this
JobNumber SupplyParts
J001 Tyres
Mirrors
Bonnets
Rear Bumper
J002 Side Bumper
Bonnet
Seat Cover
Please tell me how to insert values into the column JobNumber and SupplyParts with a single insert statement where column SupplyParts will have multiple rows and at the same time JobNumber value will be only One.
Currently iam inesrting values like this
string InsertName = "insert into ComplaintSupply" +
"(JobNum, SupplyParts)"
+ "values('" + this.txtSupplyParts1.Text + "'),('" + this.txtSupplyParts2.Text + "'),('" + this.txtSupplyParts3.Text + "'), ('" + this.txtSupplyParts4.Text + "'),('" + this.txtSupplyParts5.Text + "')";
MySqlCommand command = new MySqlCommand(InsertName, ComplaintSupply.con);
ComplaintSupply.dComplaintSupplyAdapter.InsertCommand = command;
//Insert New Record.
ComplaintSupply.dComplaintSupplyAdapter.InsertCommand.ExecuteNonQuery();
In the above code i am inserting multiple rows for SupplyParts column from different 5 textboxes but iam not getting how to insert value for JobNum column taking value from some other text box say txtJobNum.
Any help will be greatly appreciated. I am new with database and could not able to solve this issue from last 1 week
Thanks in Advance
Imran
|
|
|
|
|
Hi
Your problem is more SQL related than ASP.NET related. I'd post this in the SQL forum. Also, don't build up SQL strings by concatonation. You are wide open to SQL Injection Attacks[^]
Small angry dogs
|
|
|
|
|
By default I have 10 rows of dynamically created controls on Page Load. After entering Data, When i click Submit button, only rows in which data entered should be inserted into the database.
I am inserting records based on the table rows count. So, it inserts 10 records even if values are not entered.
protected void btnSubmit_Click(object sender, EventArgs e)
{
int j = tblRunTime.Rows.Count;
for (int c = 0; c < j; c++)
{
string query = " INSERT INTO Time VALUES( ";
query = query + " '" + Request.Form["_dr1" + c.ToString()] + "', ";
query = query + " '" + Request.Form["_dr2" + c.ToString()] + "', ";
query = query + " '" + Request.Form["text1" + c.ToString()] + "', ";
...
query = query + " '" + Request.Form["text8" + c.ToString()] + "', ";
query = query + " '" + f_date_b.Value + "'";
query = query + " )";
}
So, how i can solve this?
Can anyone please help me?
Thanks & Regards,
Radha
|
|
|
|
|
In this, you are not checking the value is entered or not. And your controls are dynamically created on page_load, which don't have a viewstate maintained. So you won't get values for those controls. Consider creating it in some other event like (Init). Also read about SQL Injection attacks.
|
|
|
|
|
But, I can get values for those controls. If i enter Data for 2 rows and click Submit button, 2 rows will be inserted with the entered values and the remaining 8 rows will be inserted with null values. I dont want that 8 rows to be inserted.
Thanks & Regards,
Radha
|
|
|
|
|
Before insertion, check the controls has a value. If not sip it,
|
|
|
|
|
But, I can get values for those controls. If i enter Data for 2 rows and click Submit button, 2 rows will be inserted with the entered values and the remaining 8 rows will be inserted with null values. I dont want that 8 rows to be inserted. How can i do this?
Thanks & Regards,
Radha
|
|
|
|
|
hi,
Can anyone tell me how to bind a DataTable Column field to a DropDownList Items which is present in a GridView.
DataTable and GridView is generated at runtime.
A key to every Solution
|
|
|
|
|
You need to find DropDown from GridView in GridView's RowDataBound event and bind it.
|
|
|
|
|
Thanks,
Can I add it like Eval on Bind method as we do for label..
<asp:templatefield headertext="CUST_ID">
<headertemplate>CUST_ID
<itemtemplate>
<asp:label id="lblCustID" text="">]]>' runat="server">
I have the DropDownList instead of Label and CUST_ID is the Column anme present in the DataTable
A key to every Solution
|
|
|
|
|
Thanks,
Can I add it like Eval on Bind method as we do for label..
<asp:templatefield headertext="CUST_ID">
<headertemplate>CUST_ID
<itemtemplate>
<asp:label id="lblCustID" text="">]]>' runat="server">
I have the DropDownList instead of Label and "CUST_ID" is the Column name present in the DataTable
A key to every Solution
|
|
|
|
|
You can add the dropdownlist to the template column at runtime. then, In rowcreated event of Gridview, you can find the dropdownlist that you have added and bind the data.
|
|
|
|
|
hi,
thanks friend..
can u give a sample of code how to it...
A key to every Solution
|
|
|
|
|
Hi all,
Can I add Change the PageStyle Button like HTML Buttons in Datagrid using ASP.Net 1.0
Thanks
Dana
|
|
|
|
|
You can't add a HTML button there. Use CSS to style current pager links to look like a HTML button.
|
|
|
|
|
Thanks for the reply Navan,
Can I add the sylesheets in the desing view itself ?
Dana
|
|
|
|
|
Yes. Datagrid allows you to add a pager style tag.
|
|
|
|
|
Thanks.. I wll have a try
Dana
|
|
|
|
|
I tried like this .But it is not displaying any box arround the Next or previous buttons<br />
<br />
<br />
<br />
<PagerStyle NextPageText="Next" PrevPageText="Previous" Position="TopAndBottom" BorderStyle="Solid"<br />
BorderWidth="1" Mode=NextPrev ><br />
|
|
|
|
|
Pager links are just hyperlinks. So create a CSS class which can style the hyperlinks and assign that class to the pager style.
|
|
|
|
|
I tried this one...
But It applied the whole row...
color: #FFFFFF; text-decoration: none; text-transform: none; background:
#800000;
|
|
|
|
|
Hi there,
I created an installer which installs two msi files. This installer is working fine in Xp and 98. But it's giving error in Vista. The error is: Another Process is running. Is there any other way to rectify this problem? Please help..!!
Regards n Thks
Sam.M
modified on Monday, January 14, 2008 4:33:04 AM
|
|
|
|