15,908,906 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 Member 11970398 (Top 86 by date)
Member 11970398
29-Jan-16 7:44am
View
transaction.Rollback();
error in transaction
unassign
Member 11970398
29-Jan-16 7:00am
View
if some lines give error it should roll back
Member 11970398
29-Jan-16 2:05am
View
if i upload same file also first time ok 2nd time saying this thing
Member 11970398
29-Jan-16 2:05am
View
i tried its saying the file is being processed and comes to catch
Member 11970398
29-Jan-16 2:03am
View
i tried its saying the file is being processed and comes to catch
Member 11970398
28-Jan-16 2:45am
View
yeah i know that but only i have t write it web.config file or some where else
Member 11970398
28-Jan-16 2:12am
View
supposre student can acces student url and teacher can access teacher url if student paste the url directy he is able to go ito the teachers the page..how to restrict
Member 11970398
28-Jan-16 2:11am
View
how can i restrict the user to access the url if this url is not fo that particular user
Member 11970398
27-Jan-16 5:26am
View
i think i have not use try catch in proper position
Member 11970398
27-Jan-16 2:38am
View
Deleted
plz help me
Member 11970398
27-Jan-16 2:03am
View
its directly coming to catch directly and showing the file is being process
Member 11970398
25-Jan-16 8:26am
View
ITS COMING TO CATCH DIRECTLY WITH OUT GOING TO TRY BLOCK
Member 11970398
25-Jan-16 7:28am
View
suppose i upload timesheet.xls its uploading
then if i go for hello.xls its giving error againg if i am going for timesheet.xls again its giveing error showing file is being in process
Member 11970398
25-Jan-16 7:03am
View
Thanx
Member 11970398
18-Jan-16 12:55pm
View
getdata is a function in SQL server i am writing this query in visual studio
Member 11970398
18-Jan-16 8:57am
View
yeah out of bound errrror
Member 11970398
18-Jan-16 0:23am
View
he i am getting the value there but when i am using that value in listbx in razor view its showing error objectt reference not set
Member 11970398
14-Jan-16 2:02am
View
after makeing the change Text = Convert.ToString(row["TestName"]),
Value = Convert.ToString(row["TestID"])
its not givng any error but testList is null
Member 11970398
14-Jan-16 1:41am
View
in lstProfessional.Add(
new SelectListItem
{
Text = Convert.ToInt32(row["ID"]),
Value = Convert.ToString(row[DescriptionName]
});
}
Member 11970398
14-Jan-16 1:41am
View
Deleted
showing Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot implicitly convert type 'int' to 'string'
Member 11970398
13-Jan-16 8:48am
View
public SelectList GetAllprofsssinList()
{
var PList = new List<Profession&();
ds = dropdown.GetDropDownList();
for (int record = 0; record <= ds.Tables[1].Rows.Count - 1; record++)
{
Profession objprof = new Profession();
dynamic row = ds.Tables[1].Rows[record];
objprof.ProfessionId = Convert.ToInt32(row["ID"]);
objprof.ProfessionName = Convert.ToString(row[DescriptionName];
plist.add(objprof );
}
SelectList testList = new SelectList(PList,ProfessionId;, ProfessionName;
return testList;
}
Member 11970398
13-Jan-16 8:47am
View
public SelectList GetAllprofsssinList()
{
var PList = new List<Profession&();
ds = dropdown.GetDropDownList();
for (int record = 0; record <= ds.Tables[1].Rows.Count - 1; record++)
{
Profession objprof = new Profession();
dynamic row = ds.Tables[1].Rows[record];
objprof.ProfessionId = Convert.ToInt32(row["ID"]);
objprof.ProfessionName = Convert.ToString(row[DescriptionName];
plist.add(objprof );
}
SelectList testList = new SelectList(PList,ProfessionId;, ProfessionName;
return testList;
}
Member 11970398
13-Jan-16 7:00am
View
how to show data in 1st table should i use list box because i tried but unfortnitely unsuccessed
Member 11970398
13-Jan-16 4:56am
View
can u help with this
Member 11970398
13-Jan-16 4:22am
View
SelectList testList = new SelectList(PList,ProfessionId;, ProfessionName;
i am getting value to Plist here but cant assign that value to testlist
testlist is null coming
Member 11970398
13-Jan-16 2:20am
View
can u resolve this issue
Member 11970398
13-Jan-16 1:38am
View
no i tried that also but not getting that value there(testList )
Member 11970398
13-Jan-16 1:24am
View
can any one help
Member 11970398
30-Dec-15 5:45am
View
Deleted
yeah i am using that but its downloading that image directly .i want to show that Word document in pop up
Member 11970398
30-Dec-15 5:44am
View
yeah i am using that but its downloading that image directly .i want to show that image in pop up
Member 11970398
30-Dec-15 4:55am
View
sorry i could not understand properly
i am storing the image in the project and the path in database how to display that word document in view
Member 11970398
30-Dec-15 0:53am
View
if (Request.Files["file"].ContentLength > 0)
{
string fileExtension =
System.IO.Path.GetExtension(Request.Files["file"].FileName);
if (fileExtension == ".xls" || fileExtension == ".xlsx")
{
string fileLocation = Server.MapPath("~/ExcelUpload/") + Request.Files["file"].FileName;
if (System.IO.File.Exists(fileLocation))
{
System.IO.File.Delete(fileLocation);
}
Request.Files["file"].SaveAs(fileLocation);
string excelConnectionString = string.Empty;
excelConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +
fileLocation + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";
//connection String for xls file format.
if (fileExtension == ".xls")
{
excelConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
fileLocation + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"";
}
//connection String for xlsx file format.
else if (fileExtension == ".xlsx")
{
excelConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +
fileLocation + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";
}
//Create Connection to Excel work book and add oledb namespace
OleDbConnection excelConnection = new OleDbConnection(excelConnectionString);
excelConnection.Open();
DataTable dt = new DataTable();
dt = excelConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (dt == null)
{
return null;
}
String[] excelSheets = new String[dt.Rows.Count];
int t = 0;
//excel data saves in temp file here.
foreach (DataRow row in dt.Rows)
{
excelSheets[t] = row["TABLE_NAME"].ToString();
t++;
}
OleDbConnection excelConnection1 = new OleDbConnection(excelConnectionString);
string query = string.Format("Select * from [{0}]", excelSheets[0]);
using (OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, excelConnection1))
{
dataAdapter.Fill(ds);
}
}
if (fileExtension.ToString().ToLower().Equals(".xml"))
{
string fileLocation = Server.MapPath("~/ExcelUpload/") + Request.Files["FileUpload"].FileName;
if (System.IO.File.Exists(fileLocation))
{
System.IO.File.Delete(fileLocation);
}
Request.Files["FileUpload"].SaveAs(fileLocation);
XmlTextReader xmlreader = new XmlTextReader(fileLocation);
ds.ReadXml(xmlreader);
xmlreader.Close();
}
Member 11970398
29-Dec-15 6:03am
View
i am getting error and its going to the code directly
Member 11970398
29-Dec-15 5:59am
View
how can i give condition there in my code that the file is being open or
Member 11970398
29-Dec-15 3:16am
View
i want to upload excel sheet into database. if the file is being used its giving error how can i give error message that this file is being used
Member 11970398
16-Dec-15 5:45am
View
can u help me with this
Member 11970398
15-Dec-15 1:19am
View
solved
Member 11970398
11-Dec-15 5:26am
View
public ActionResult Upload(HttpPostedFileBase uploadFile)
{
String strConnection = "Data Source=Server=BANKING1\\MSSQLSERVER1;initial catalog=Online; User ID=sa;Password=Aldd439";
//file upload path
string path = uploadFile.ToString();
//Create connection string to Excel work book
string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;Persist Security Info=False";
//Create Connection to Excel work book
OleDbConnection excelConnection =new OleDbConnection(excelConnectionString);
//Create OleDbCommand to fetch data from Excel
OleDbCommand cmd = new OleDbCommand("Select [ID],[Name],[Designation] from [Sheet1$]",excelConnection);
excelConnection.Open();
OleDbDataReader dReader;
dReader = cmd.ExecuteReader();
SqlBulkCopy sqlBulk = new SqlBulkCopy(strConnection);
//Give your Destination table name
sqlBulk.DestinationTableName = "ALQuestion.QuestionMaster";
sqlBulk.WriteToServer(dReader);
excelConnection.Close();
Member 11970398
11-Dec-15 4:02am
View
which column it show where i will pass that column name
Member 11970398
11-Dec-15 3:59am
View
where i will pass the id so that it will take image for that id only
Member 11970398
11-Dec-15 3:54am
View
what is the model class for this
Member 11970398
10-Dec-15 2:28am
View
OleDbConnection excelConnection = new OleDbConnection(excelConnectionString);
i use SqlConnection excelConnection = new SqlConnection (excelConnectionString);
Member 11970398
10-Dec-15 2:28am
View
here u have written
dt = excelConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if it is sql server database then how to write this line
dt = excelConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
Member 11970398
10-Dec-15 1:47am
View
can u help me with this
Member 11970398
10-Dec-15 1:47am
View
i have one date1 =12/08/1991
another date2 = 17/06/1995
how to compare 2 dates if date2 is less than date1 give error
Member 11970398
10-Dec-15 0:38am
View
how to compare 2 dates if date 2 is less than date1 give error
Member 11970398
9-Dec-15 23:55pm
View
i am not talking about that .i have a value in one controler how can i show that in different view associated with different controler
Member 11970398
2-Dec-15 2:35am
View
i have a excel sheet some columns and rows are there i want to store that into database by giving upload option
Member 11970398
2-Dec-15 2:33am
View
done done
Member 11970398
2-Dec-15 2:18am
View
if i have one more parameter like validdate then how will i add
Member 11970398
26-Nov-15 6:37am
View
i am using sql server database
Member 11970398
24-Nov-15 1:02am
View
sorry dear ,i want to compare according to their potion value not any where neither sorting
Member 11970398
23-Nov-15 7:43am
View
can u help me with this
Member 11970398
23-Nov-15 1:06am
View
plz help me
Member 11970398
23-Nov-15 1:00am
View
yes nothing happen
Member 11970398
20-Nov-15 6:36am
View
i have tried like
HttpPostedFileBase file = Request.Files["file"];
objc.ContentType = file.ContentType;
Int32 length = file.ContentLength;
byte[] tempImage = new byte[length];
file.InputStream.Read(tempImage, 0, length);
objc.ProfileImage = tempImage;
but showing object reference null
Member 11970398
20-Nov-15 6:26am
View
Sorry ,Can u Please correct my code ,i am unable to do so
Member 11970398
18-Nov-15 7:47am
View
i am not using entity framework
Member 11970398
18-Nov-15 6:45am
View
i have registration page the upload image file go with all other input file like name no .... at a time and insert into database
dont know wehere to write the method to convert the image into bytes
Member 11970398
18-Nov-15 4:25am
View
when i am running my business logic i should get the value but i am getting success
Member 11970398
18-Nov-15 1:42am
View
public class b_GroupTest
{
SqlHelper sh = new SqlHelper();
public DataSet TestQuestions(GroupTest Gt)
{
DataSet ds = new DataSet();
try
{
SqlParameter[] param ={
new SqlParameter("@TotalQuestions",Gt.NoofQuestions),
new SqlParameter("@Companyid",Gt.comp),
};
return ds = sh.ExecuteDataset("dbo.Sp_GetQuestions", param);
}
catch (Exception ex)
{ }
return ds;
}
}
here i have pass2 parameter one input as company and a parameter @testid which i get the output value .
Member 11970398
18-Nov-15 1:40am
View
can u check this method .is it perfect ?
Member 11970398
18-Nov-15 1:39am
View
HERE ONLY GIVING ERROR WITHOUT ANY BUSINESS LOGIC
I THING IN METHOD SOME ERROR IS THERE
Member 11970398
18-Nov-15 1:33am
View
in return line error string invalid expression
Member 11970398
18-Nov-15 1:25am
View
public int ExecuteScalar(String storedprocedure, params SqlParameter[] arrParam)
{
SqlConnection cn = new SqlConnection(connection());
try
{
//initialisation of datatable, Sql connection and sql command
DataSet dt = new DataSet();
SqlCommand cmd = new SqlCommand(storedprocedure, cn);
cmd.CommandType = CommandType.StoredProcedure;
//opens the db connection
if (cn.State == ConnectionState.Closed || cn.State == ConnectionState.Broken)
cn.Open();
//if sql param is not null then gets the parameters from that
if (arrParam != null)
{
foreach (SqlParameter param in arrParam)
cmd.Parameters.Add(param);
}
cmd.CommandTimeout = 5000;
//executes the command and fills it into the datatable
return string;
}
catch (Exception ee)
{
return null;
}
finally
{
cn.Close();
}
}
its showing error on return
it should return 2 thins if success true of false type or 1 ,0
Member 11970398
16-Nov-15 5:14am
View
showing
An exception of type 'System.IndexOutOfRangeException' occurred in sb-admin-2.Web.dll but was not handled in user code
Additional information: Index was outside the bounds of the array.
Member 11970398
16-Nov-15 5:03am
View
he u are talking about if(a.length == b.length && c.length==b.length){
for(int x = 0; x < a.length; x++){
parameterA = a[x];
parameterB = b[x];
parameterC = c[x];
//execute the query
}
}
this one
Member 11970398
16-Nov-15 4:56am
View
yeah i am getting like this only 9 times its inserting instead of 3 times ,can u correct my code plz
Member 11970398
16-Nov-15 4:47am
View
sorry i did not get u
Member 11970398
16-Nov-15 4:40am
View
plz help me
Member 11970398
16-Nov-15 4:36am
View
i am using for (int i = 0; i <= Skill.Length; i++)
[Code moved to question: AL]
Member 11970398
16-Nov-15 3:55am
View
yes
Member 11970398
9-Nov-15 7:05am
View
i have 3 text box what value's u enter there it will display below ,the more u enter the values into text box it will come below the previous input value ,how to store these value in database
Member 11970398
5-Nov-15 8:04am
View
after first submit everything fine when i insert details it taking the value from 100 instead of current
suppose you insert percentage 30 percentage
first condition perfect again the current should 70 when it validating it validation from 100 not from 70
Member 11970398
3-Nov-15 2:49am
View
no i am no taking about that
Member 11970398
3-Nov-15 2:41am
View
not working these values will come dynamically no of times he enter text box and click submit it will dispaly below and the end there is insert button if he click it it will go to controler
Member 11970398
2-Nov-15 4:37am
View
thanx
done
Member 11970398
2-Nov-15 2:55am
View
how to do it in jquery
Member 11970398
2-Nov-15 2:41am
View
i have text box and a button .in this text box maximum 100 can be entered
first time user come and enter some values and click submit value if the value is less than 100 then k aain one more user come and he enters some values if this value and the previues value enterd should not exceed mor than 100 ,uless that summetion goes to humdread u can enter some value and clik submit button not more
Member 11970398
28-Oct-15 7:57am
View
@model IEnumerable<sb_admin_2.web.models.grouptest>
GroupTests
<table class="table">
<tr>
<th>QuestionName</th>
<th>Option A</th>
<th>Option B</th>
<th>Option C</th>
<th>Option D</th>
<th>Answer</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.QuestionName)
</td>
<td>
@Html.DisplayFor(modelItem => item.Option1)
</td>
<td>
@Html.DisplayFor(modelItem => item.Option2)
</td>
<td>
@Html.DisplayFor(modelItem => item.Option3)
</td>
<td>
@Html.DisplayFor(modelItem => item.Option4)
</td>
<td>
@Html.DisplayFor(modelItem => item.Answer)
</td>
</tr>
}
</table>
<div class="modal-footer">
<button type="submit" class="btn btn-default" data-dismiss="modal">Update Qn</button>
</div>
Member 11970398
28-Oct-15 7:57am
View
@{ ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section scripts
{
<script type="text/javascript" src="~/Scripts/jquery-1.7.1.js"></script>
<script type="text/javascript" src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
}
<div class="add-ques-form create-test group-test">
@Ajax.BeginForm("ShowDetails", "Demo",
new AjaxOptions
{
HttpMethod = "POST",
UpdateTargetId = "div1",
InsertionMode = InsertionMode.Replace,
})
<div class="row mb10">
<div class="row row1">
<div class="col-md-4"><label class="">Name of The Test :</label></div>
<div class="col-md-2"><label class=""> Total No.of Questions :</label></div>
<div class="col-md-2"><label class="">Skill :</label></div>
<div class="col-md-2"><label class="">Level :</label></div>
<div class="col-md-2"><label class=""> Skill Percentage :</label></div>
</div>
<div class="row row2">
<div class="col-md-4">
<input type="text" id="QnName" name="QnName" placeholder="Name of test" />
</div>
<div class="col-md-2">
<input type="text" id="NoOfqn" name="NoOfqn" placeholder="" />
</div>
<div class="col-md-2">
@Html.DropDownList("SkillId", (IEnumerable<SelectListItem>)ViewBag.SkillList, " -- Select Your Skill -- ", new { id = "SkillId", name = "SkillName", @class = "select1" })
</div>
<div class="col-md-2">
@Html.DropDownList("LevelId", (IEnumerable<SelectListItem>)ViewBag.LevelList, " -- Select Your Level -- ", new { id = "LevelId", name = "LevelName", @class = "select1" })
</div>
<div class="col-md-2">
<input type="text" id="Percentage" name="Percentage" placeholder="" />
</div>
</div>
<div class="input_fields_wrap">
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-default" data-dismiss="modal">Get Question</button>
</div>
</div>
</div>
@{Html.EndForm();}
<div id="div1">
</div>
Member 11970398
27-Oct-15 7:26am
View
there will be 3 text box
one will be for question and remaining 2 will be for answer and continue
the more he will click add button these 3 field will be added and at the end clicking the submit button all the values in that form will be inserted into database
Member 11970398
29-Sep-15 2:00am
View
sorry dear not getting what u are saying...
Member 11970398
28-Sep-15 2:58am
View
sorry could not understand
Member 11970398
28-Sep-15 2:15am
View
he u took me wrong i want details should be shown if u take the mouse over one date in the calendar
Member 11970398
18-Sep-15 6:32am
View
public class UserRegistration
{
[Required(ErrorMessage = "Please Enter Name")]
[Display(Name = "Name")]
public string Name { get; set; }
[Required(ErrorMessage = "Please Enter Email Address")]
[Display(Name = "Email")]
[RegularExpression(@"^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$",
ErrorMessage = "Please Enter Correct Email Address")]
public string Email { get; set; }
[Required(ErrorMessage = "Please Enter Mobile No")]
[Display(Name = "Mobile")]
[StringLength(10, ErrorMessage = "The Mobile must contains 10 characters", MinimumLength = 10)]
public string Phone { get; set; }
public string Profession { get; set; }
public string MainSkill { get; set; }
public string Education { get; set; }
public string Stream { get; set; }
public DateTime Age { get; set; }
// public string Usertype { get; set; }
public string Address { get; set; }
// public string CompanyName { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Pincode { get; set; }
public string country { get; set; }
}
Show More