16,011,680 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 .NET 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 Member 9176543 (Top 25 by date)
Member 9176543
17-Mar-15 13:35pm
View
Hi,
I have done that, heres my View.
@model SocialAuthentication.Models.Users
@foreach (var item in Model.Name)
{
<ul>
<li>
@item
</li>
</ul>
}
If you will copy past my code debug it then will release that in the Controller action method
var result = db.Database.SqlQuery<users>("usp_searchuser, @UserInput", new SqlParameter("@UserInput", textboxValue));
returns nothing that why no data is passed to the view.
Member 9176543
16-Dec-13 21:57pm
View
Thanks for replying but this is not what I am looking for.
My need is:
Eg on 1st row there are 5 thumbnails next to each other after few seconds all the 5 images changes and new images are seen in their place the cycle keeps on repeating.
Member 9176543
6-Nov-13 23:40pm
View
How do I solve it.
Member 9176543
6-Nov-13 10:22am
View
Null is passed and why out keyword is used.
Member 9176543
6-Nov-13 9:32am
View
Same Error on line int.TryParse(textBoxWithdrawalAmount.Text, out WithdrawalAmount);
Object reference not set to an instance of an object.
Member 9176543
5-Nov-13 9:59am
View
Object reference not set to an instance of an object.
on the First Line.
I have verified all the id names.
Member 9176543
4-Nov-13 6:31am
View
Hi Tadit Dash,
I tried to loop it but it doesnt works. It throughs an exception
protected void btnsubmit_Click(object sender, EventArgs e)
{
foreach (GridViewRow row in grdDailyReport.Rows)
{
int WithdrawalAmount = Convert.ToInt16(((TextBox)row.FindControl("txtWithdrawalAmount")).Text);
int Balance = Convert.ToInt16(((TextBox)row.FindControl("txtBalance")).Text);
string BankName = ((DropDownList)row.FindControl("ddlBankName")).SelectedItem.Value;
string WorkerLabour = ((TextBox)row.FindControl("txtWorkerLabour")).Text;
int PurchaseMatrialAmount = Convert.ToInt16(((TextBox)row.FindControl("txtlPurchaseMatrialAmount")).Text);
string PurchaseAgainst = ((DropDownList)row.FindControl("ddlPurchaseAgainst")).SelectedItem.Value;
string Comments = ((TextBox)row.FindControl("txtComments")).Text;
DataAccessLayer.SaveDailyReport(WithdrawalAmount, Balance, BankName, WorkerLabour, PurchaseMatrialAmount, PurchaseAgainst, Comments);
}
BindData();
Member 9176543
4-Nov-13 5:43am
View
Hi Tadit Dash,
The other controls works fine like if i hard code the txtComments field then all other controls works properly i.e i can perform CRUD operations
Here is my DataAccessLayer
public static int SaveDailyReport(int WithdrawalAmount, int Balance, string BankName, string WorkerLabour, int PurchaseMatrialAmount, string PurchaseAgainst, string Comments)
{
DataSet ds = new DataSet();
string CS = ConfigurationManager.ConnectionStrings["connectivity"].ConnectionString;
using (SqlConnection con = new SqlConnection(CS))
{
SqlCommand command = new SqlCommand("usp_sel_DailyReport", con);
command.CommandType = CommandType.StoredProcedure;
SqlParameter ParamWithdrawalAmount = new SqlParameter("@WithdrawalAmount", WithdrawalAmount);
command.Parameters.Add(ParamWithdrawalAmount);
SqlParameter ParamBalance = new SqlParameter("@Balance", Balance);
command.Parameters.Add(ParamBalance);
SqlParameter ParamBankName = new SqlParameter("@BankName", BankName);
command.Parameters.Add(ParamBankName);
SqlParameter ParamWorkerLabour = new SqlParameter("@WorkerLabour", WorkerLabour);
command.Parameters.Add(ParamWorkerLabour);
SqlParameter ParamPurchaseMatrialAmount = new SqlParameter("@PurchaseMatrialAmount", PurchaseMatrialAmount);
command.Parameters.Add(ParamPurchaseMatrialAmount);
SqlParameter ParamPurchaseAgainst = new SqlParameter("@PurchaseAgainst", PurchaseAgainst);
command.Parameters.Add(ParamPurchaseAgainst);
SqlParameter ParamComments = new SqlParameter("@Comments", Comments);
command.Parameters.Add(ParamComments);
con.Open();
return command.ExecuteNonQuery();
}
}
Member 9176543
4-Nov-13 4:00am
View
Hi,
What is Rows[i],i cant write i it says its not found.I tried
string Comments = Convert.ToString((TextBox)grdDailyReport.Rows[0].Cells[8].FindControl("txtComments"));
but the value in the comment variable is blank.
And how other fields are allowed except this Comment 1.
Member 9176543
27-Oct-13 11:22am
View
Hi,
I know that a new SP can be written but there would be a way to achieve this in a single SP,I want to know that.
Member 9176543
15-Sep-13 2:07am
View
Thank You.
Member 9176543
15-Sep-13 2:01am
View
Did you mean this
alter PROCEDURE usp_insertupdatepragimcrud
@EmployeeID int = null,
@Name varchar(50),
@Gender varchar(10),
@City varchar(50)
as begin
if(@EmployeeID is null)
insert into tblEmployeeDataAccessLayer (Name,Gender,City) values (@Name,@Gender,@City)
else
update tblEmployeeDataAccessLayer set Name=@Name,Gender=@Gender,City=@City where employeeid=@EmployeeID
end
Member 9176543
15-Sep-13 0:47am
View
Employee Id is set to is Identity,cant make it to allow nulls.
Member 9176543
19-Jul-13 4:31am
View
Thanks, as if now i am getting syntax errors when copying your latest solution trying to solve them,will update you when its done
Member 9176543
19-Jul-13 0:24am
View
Pallavi Waikar,
Yes it works correctly then the auto complete doesnt work.
Member 9176543
18-Jul-13 9:13am
View
Hi Pallavi Waikar ,
The entire code that you gave above works fine the thing is that if we clear the textbox then the entire Data is visible.
Member 9176543
18-Jul-13 7:02am
View
Hi Nila1991,
I dont want to bind textbox in gridview,have to bind it with gridview.
Ex you are a user and you enter India then the details of India should be displayed in gridview.
Member 9176543
18-Jul-13 6:59am
View
No error, nothing happens
Member 9176543
18-Jul-13 5:10am
View
Its not working, autopostback is true, after selecting value like kiran then it loads and shows the first initial in the textbox and gridview is not displayed
Member 9176543
26-Jun-13 0:34am
View
Hi Madhav Hatwalne,
I get a error in the C# code
'string' does not contain a definition for 'text' and no extension method 'text' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
Store Procedure
Create Procedure dsp_GridData
@flag VARCHAR(10),
@Value VARCHAR(10)
As
BEGIN
SET NOCOUNT ON
IF @flag = 'ID'
BEGIN
SELECT id,Name,Description FROM tblproducts where id = CONVERT(int,@value) /* AS your id is int*/
END
IF @flag = 'Name'
BEGIN
SELECT Name,Description FROM tblproducts where Name = @value /* AS your id is int*/
END
SET NOCOUNT OFF
END
C#
protected void ddllist_SelectedIndexChanged(object sender, EventArgs e)
{
string flag;
if (ddllist.SelectedValue.text == "ID")
{
flag = "ID";
}
else if (ddllist.SelectedValue.text == "Name")
{
flag = "Name";
}
// and so on for all other flag
string cn = ConfigurationManager.ConnectionStrings["connectivity"].ConnectionString;
using (SqlConnection connection = new SqlConnection(cn))
{
SqlCommand command = new SqlCommand("dsp_GridData", connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@flag", flag);
command.Parameters.AddWithValue("@value", TextBox1.Text);
SqlDataAdapter da = new SqlDataAdapter(command);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}
}
Member 9176543
25-Jun-13 13:11pm
View
Vipin kumar
The value should come from the textbox
The above code just binds dropdown with gridview.
Member 9176543
18-Jun-13 2:09am
View
Thanks Ariana and Rohan.
Member 9176543
18-Jun-13 1:43am
View
And if a user selects the initial value then how to
Display a messsge ,"No Record Selected"
Member 9176543
12-May-13 0:47am
View
How do I confirm these two things
Have you conform that port 25 is open?
Smtp is white listed.
Member 9176543
10-May-13 12:39pm
View
My intension was not to waste any ones time, its true that the above mentioned code is not copy pasted properly I have typed it and as per your comment the missing method is already mentioned above, infact there is a compile time error here Msg.Body = myString.ToString();
Before posting my query I have searched the web for examples major examples belongs to sending email through gmail which is running properly but rare article on sending through newly hosted domain name.
Correct code is
MailMessage Msg = new MailMessage();
Msg.From = new MailAddress("sales@mydomain.com", "Testing");
Msg.To.Add(TxtEmail.Text);
Msg.Subject = "Send Mail with HTML File";
Msg.Body = "Test";
SmtpClient client = new SmtpClient();
client.Host = "mail.mydomain.com";
client.Port = 25;
client.Credentials = new NetworkCredential("sales@mydomain.com", "password");
client.Send(Msg);
Show More