15,908,931 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by solanki.net (Top 68 by date)
solanki.net
12-Mar-13 4:34am
View
can u explain on which event u want to delete row ?
solanki.net
12-Mar-13 1:33am
View
where are your using combobox inside grid or where ? and on which event u want to validate ? explain your question
solanki.net
5-Mar-13 5:15am
View
but in your code u did not use database connection like that :
report.SetDatabaseLogon("userid", "pas", "server", "database");
solanki.net
4-Mar-13 6:34am
View
Deleted
who will finis office work .first do your office work
solanki.net
21-Jan-13 6:15am
View
your welcome , .d is used to get data from object .
solanki.net
18-Jan-13 2:20am
View
u know we cant create multiple primary key .if u want to apply primary key on two column then u will have to make composite primary key .can u tell why u need two primary key in a single table ?
solanki.net
18-Jan-13 2:10am
View
do u have any doubt ?
solanki.net
18-Jan-13 1:06am
View
If u add id column in tblComboDetails table then apply join on id column then u can get 3rd row but not 4th row because your second table has only 3 record .if your second table (tblComboDetails ) has four record then u can get 3rd and 4th row also.
solanki.net
18-Jan-13 1:03am
View
your welcome
solanki.net
18-Jan-13 0:41am
View
and declare _sum as global
static int _sum=0
solanki.net
18-Jan-13 0:39am
View
Put the break point and check value is coming or not in total .
solanki.net
18-Jan-13 0:27am
View
// I all ready told u use global variable .improve your logic
//Declare global variable int _sum=0;
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { int total=0; if (e.Row.RowType == DataControlRowType.DataRow) { total = Convert.ToInt32(((DataRowView)e.Row.DataItem)["total"].ToString()); // its showing error in this line "cannot apply indexing with [] to an expression of type object.
_sum +=total;
} if (e.Row.RowType == DataControlRowType.Footer) { Label lblamount7 = (Label)e.Row.FindControl("Label27"); lblamount7.Text =_sum.ToString(); } }
solanki.net
17-Jan-13 23:55pm
View
send your code
solanki.net
17-Jan-13 5:21am
View
show me your code
solanki.net
17-Jan-13 3:41am
View
can u explain more ? if u click prev button then what r u doing i mean redirecting to first page or what ?
solanki.net
17-Jan-13 3:32am
View
Your welcome
solanki.net
5-Oct-12 9:16am
View
k
solanki.net
5-Oct-12 4:15am
View
U should add name space like that
using BL;
solanki.net
5-Oct-12 1:55am
View
k
solanki.net
5-Oct-12 1:27am
View
can u explain how ?
solanki.net
4-Oct-12 8:52am
View
suppose u have table that contain your all search result.
then session["Record"] =dt;// for storing table in session.
// if u want to get this session on other page then
DataTable dt=new DataTable();
dt=session["Record"] as DataTable;
solanki.net
4-Oct-12 8:11am
View
if u r using javascript then i think we cant change .
solanki.net
4-Oct-12 7:59am
View
same thing u will have to do .
change here only
SqlCommand cmd = new SqlCommand(" write query here for selecting data " );
sqlDataAdapter sda=new sqlDataAdapter (cmd);
DataTable dt=new DataTable();
sda.fill(dt);
then u can bind your controls
ex: textbox1.Text= dt.Rows[0][0].ToString();
solanki.net
4-Oct-12 7:32am
View
k, Now on Edit button click event u should hit database for getting result(select * from tableName) and from front end u will have to send id(id of record that u want to edit ) .according to that id u will get datatable .
then u can bind your controls with table columns.
solanki.net
4-Oct-12 7:14am
View
can i show your code what r u writing on click of Add button ?
solanki.net
4-Oct-12 7:12am
View
your welcome.
solanki.net
4-Oct-12 7:00am
View
then its difficult to solve your problem without checking your code.
solanki.net
4-Oct-12 6:42am
View
k,then u should set validation group for your all controls .
solanki.net
4-Oct-12 6:31am
View
sorry i thought u directly saying no for your code .
solanki.net
4-Oct-12 6:26am
View
change your attitude next time when u asking help dont give response like that .i am not interested in your code u only asked for help then only i asked your code.
solanki.net
4-Oct-12 6:09am
View
have u given same validation group name for any other control ? if not send code of your both grids
solanki.net
4-Oct-12 5:48am
View
send me your code
solanki.net
4-Oct-12 4:43am
View
suppose your child grid has textbox and link button 'Add' in footer .then u should do like that :
<footertemplate>
<asp:TextBox ID="txtName" runat="server" ValidationGroup="ChildFooter" >
<asp:RequiredFieldValidator ID="rfvName" runat="server" ValidationGroup="ChildFooter" ErrorMessage="Enter Name" ControlToValidate="txtName" >
<footertemplate>
<asp:LinkButton ID="btnAdd" runat="server" CommandArgument='<%#Container.DataItemIndex %>' CommandName="AddChild" Text="Add" ValidationGroup="ChildFooter">
solanki.net
4-Oct-12 3:21am
View
because validation group is same for all .set different validation group name for child grid textbox and linkbutton .means it should same for these both control but it should not match with any other validation group name (mean unique)
solanki.net
4-Oct-12 1:37am
View
declare @Stock int ,@Product int,@Total int
set @Stock=(select SUM(st.Prd_stock) from stock st inner join prodcut prd on st.Prd_Name=prd.Prd_Name and prd.Prd_chk=1)
set @Product=(select SUM(prd.Prd_qnt)Product from prodcut prd inner join stock st on st.Prd_Name=prd.Prd_Name and prd.Prd_chk=1)
set @Total=@Stock + @Product
solanki.net
4-Oct-12 1:30am
View
it means finally u want to show sum of these two column ?
solanki.net
4-Oct-12 1:17am
View
can u explain what problem r u facing ?
solanki.net
3-Oct-12 23:54pm
View
can u send your code ?
solanki.net
3-Oct-12 8:20am
View
in rowcommand event after finding dropdown , u can check value of drop down and set visible=false for textbox and button .
solanki.net
3-Oct-12 4:50am
View
can u show the code ?
solanki.net
3-Oct-12 0:09am
View
then what is problem ? change your message here
ddlTest.Items.Insert(0, new ListItem("Select", "0"));
solanki.net
1-Oct-12 7:38am
View
sry i did not get where u facing problem,if u table code then its easy to solve
solanki.net
1-Oct-12 7:26am
View
have checked code for only digits like :123455 it accepting only digits
for string length i told set MaxLength property of textbox .
solanki.net
1-Oct-12 7:14am
View
pls send your table code
solanki.net
1-Oct-12 5:42am
View
This not wastage of time ,this is learn something new .wastage time means simply sitting and waiting for ready made solution .it is write is not 100% accurate but by using your brain u can modify it .
solanki.net
1-Oct-12 5:26am
View
yes bro,after getting your message i tried for it i think it took around more two hours .
solanki.net
1-Oct-12 5:17am
View
Because here <input id="amount" name="amount" value="" /> u did not set type
i mean u should write like that :
<input id="amount" name="amount" type="text" value="" />
solanki.net
1-Oct-12 5:07am
View
Try this :
Regex regValid = new Regex("^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9]*$|_[a-zA-Z0-9]*$|.[a-zA-Z0-9]*$)?$");
It will allow like that :
test.99
te33.ttss33
test_ttssee3
-----------
but should set MaxLength of text.it is not checking minimum length of text .
On button click u can check minimum length of text .
I hope this will help u.
solanki.net
30-Sep-12 6:46am
View
hey gentleman its my code so i sent u .before sending code i am not matching my code with others .
solanki.net
30-Sep-12 4:10am
View
Your welcome .
solanki.net
30-Sep-12 2:07am
View
firstly add name space
using System.Text.RegularExpressions;
protected bool fnValidateText()
{
bool flag= true;
Regex regCharacters= new Regex("^[a-zA-Z]*$");
if(!regCharacters.IsMatch(textbox1.text))
{
flag=false;
return flag;//it will return false when validation failed
}
return flag;
}
solanki.net
29-Sep-12 3:34am
View
Yes .
solanki.net
29-Sep-12 2:29am
View
u r calling two validation functions and if validation is success then your if part will executed otherwise else part will be executed.
solanki.net
29-Sep-12 1:30am
View
Removing it will not change anything ? I am not understanding please tell me ?
solanki.net
29-Sep-12 1:17am
View
it means that when your textbox contain only number then it will return stat=false;because stat default value is false and when textbox contain only number then it will not change .
solanki.net
29-Sep-12 0:59am
View
this code is not for checking there is any number in textbox .this is for checking only number should be in textbox .if textbox contain any thing except the number then it will return stat= true.
solanki.net
28-Sep-12 8:14am
View
Because u trying to convert Description of dropdown into integer so its not possible
cmdins.Parameters.AddWithValue("@City_Id",Convert.ToInt32(ddlcity.SelectedItem.Text));
ddlcity.SelectedItem.Text)// it return text Description of dropdown
u should try this
cmdins.Parameters.AddWithValue("@City_Id",Convert.ToInt32(ddlcity.SelectedValue.Tostring()));
solanki.net
28-Sep-12 6:55am
View
your welcome
solanki.net
28-Sep-12 5:15am
View
it means every time after deleting record from grid u will have to hit database .
on rowDeleting event find id of row like that :
Label lblid = (Label)gvHardware.Rows[e.RowIndex].FindControl("lblId");
send this id with special parameter(like "Delete") and check in database value of special parameter and delete record using id .
after deleting record again u will have hit database for binding grid .
solanki.net
28-Sep-12 5:07am
View
Enjoyyyyyyyyyyyy
solanki.net
28-Sep-12 4:50am
View
public void buildgrid() { da = new SqlDataAdapter("bofc_prod", con); ds1 = new DataSet(); da.Fill(ds1);
viewstate["table"]=ds1.Tables[0]//Add this line
Grid1.DataSource = ds1.Tables[0]; Grid1.DataBind(); Grid1.Visible = true;
}
// And modify your existing code on rowdatabound event
DataTable dt = ViewState["table"] as DataTable; if(dt.Rows.Count>0 && dt!=null) {
then write code here .
}
solanki.net
28-Sep-12 4:39am
View
i asked after saving record what code u write for getting record from database .because when on page load or page refresh ,u will have to bind grid .what code u r writing to get record from database ?
solanki.net
28-Sep-12 4:31am
View
because table does not exist .so tell me,after saving record in database, how u getting record from database for binding in grid
solanki.net
28-Sep-12 4:24am
View
tell me table contain record or not
DataTable dt = ViewState["checkbox1"] as DataTable;
if(dt.Rows.Count>0 && dt!=null)
{
then write code here .
}
put break point and check table contain record or not
solanki.net
28-Sep-12 3:36am
View
firstly u check easily
Convert.ToBoolean(dt.Rows[e.Row.RowIndex]["check_bit"].ToString());
i am converting in boolean and y r taking varchar in database so how is it possible so modify this line like that
string check_bit=(dt.Rows[e.Row.RowIndex]["check_bit"].ToString());
if (check_bit == "1")
{
checkbox1.Checked = true;
}
tell me that in your table data is coming or not from database
solanki.net
28-Sep-12 3:29am
View
null reference exception means your table not contain records if it is contain then tell me what is type of column ["check_bit"] in database .
solanki.net
28-Sep-12 3:11am
View
send me your entire code and database table column name
solanki.net
28-Sep-12 3:05am
View
u got error in this line
Boolean check_bit = Convert.ToBoolean(dt.Rows[e.Row.RowIndex]["Checkbox1"].ToString());//null reference exeption
["Checkbox1"] is not checkbox id ,it is table column name so give column name here .
pls tell me it solved your problem or not ?
Show More