|
|
It's the note half a tone above C. It is also the name of the language Microsoft invented to go along with the .NET framework.
This space for rent
|
|
|
|
|
You could have easily answered this yourself simply by typing "What is C#?" into Google.
|
|
|
|
|
Now we wait for the follow-up question, "what is Google?"
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
"C# is an elegant and type-safe object-oriented language that enables developers to build a variety of secure and robust applications that run on the .NET Framework. " -- MSDN: Introduction to the C# Language and the .NET Framework[^]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
it is the subject of this forum
|
|
|
|
|
Pithy as ever.
This space for rent
|
|
|
|
|
It's what you do after you eat a lot of carrots.
Java/javascript is what you do after your carrots are digested (my advice - be in a sitting position when you do it, and wash your hands afterwards).
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I am using a model that to be converted into json with Newtonsoft Json as follows
MyCars[
Car{
Name:""
Model:""
}
Car{
Name:"",
Model:""
}
]
but I am getting
MyCar[
Car[
{Name:"",
Model:""
}
{
Name:"",
Model:""
}
]
]
how to get first format?
|
|
|
|
|
This has nothing to do with C#. You should try the Newtonsoft forums.
|
|
|
|
|
You'll need to fix your C# model, which you haven't shown.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i add auser control which has aformview control to main page dynamically with c# code ,but i set in the page load of the main page the form view with read only mode to bind the data and when i press add section in main page the form view become in insert mode but when i click insert it doesn`t do insert because it make post pack and load the page load which set the form view mode to read only to bind the data which come from the database
the problem is how to set the default mode of form view to insert in the same page which i called the control dynamically with read only mode
find the code html of the user contrl form
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="skills.ascx.cs" Inherits="JobSeeker_skills" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<asp:FormView id="Formviewskills" runat ="server" style="width:100%" DataSourceID="FormViewskillsSDS"
umbDebugShowTrace="true" DataKeyNames="SkillsID" OnItemCreated="Formviewskills_ItemCreated" >
<EditItemTemplate>
<table style="width:100%">
<tr>
<td class="col-md-6">
<asp:label class="link_sgray" id="FirstName" runat="server" >Skills: </asp:label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="Skills"
Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
<br />
<asp:Textbox style="width:100%" id="Skills" class="form-control" runat="server"
Text='<%# Bind("Skills") %>' >
</asp:Textbox>
</td>
</tr>
<tr>
<tr>
<td class="col-md-6">
<asp:label class="link_sgray" id="Label1" runat="server" >Proficiency: </asp:label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="Proficiency"
Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
<br />
<asp:DropDownList style="width:100%" id="Proficiency" CssClass="dropdown" runat="server" selectedvalue='<%# Bind("Proficiency") %>'
DataSourceID="ProficiencyDDL" DataTextField="Value" DataValueField="ID">
</asp:DropDownList>
</td>
<td class="col-md-6">
<asp:label class="link_sgray" id="Label8" runat="server" >Years of Experience: </asp:label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="YearsofExperienceSkills"
Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
<br />
<asp:DropDownList style="width:100%" id="YearsofExperienceSkills" CssClass="dropdown" runat="server" selectedvalue='<%# Bind("YearsofExperienceSkills") %>'
DataSourceID="YearsofExperienceSkillsDDL" DataTextField="Value" DataValueField="ID">
</asp:DropDownList>
</td>
<%----%>
</tr>
<tr>
<td colspan="2">
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" CssClass="btn-primary" />
<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" CssClass="btn-primary"/>
</td>
</tr>
</table>
</EditItemTemplate>
<InsertItemTemplate>
<table style="width:100%">
<tr>
<td class="col-md-6">
<asp:label class="link_sgray" id="Skillslbl" runat="server" >Skills: </asp:label>
<%----%>
<br />
<asp:Textbox style="width:100%" id="Skills" class="form-control" runat="server"
Text='<%# Bind("Skills") %>' ></asp:Textbox>
</td>
</tr>
<tr>
<td class="col-md-6">
<asp:label class="link_sgray" id="Label1" runat="server" >Proficiency: </asp:label>
<%----%>
<br />
<asp:DropDownList style="width:100%" id="Proficiency" CssClass="dropdown" runat="server" selectedvalue='<%# Bind("Proficiency") %>'
DataSourceID="ProficiencyDDL" DataTextField="Value" DataValueField="ID">
</asp:DropDownList>
</td>
<td class="col-md-6">
<asp:label class="link_sgray" id="Label8" runat="server" >Years of Experience: </asp:label>
<%----%>
<br />
<asp:DropDownList style="width:100%" id="YearsofExperienceSkills" CssClass="dropdown" runat="server" selectedvalue='<%# Bind("YearsofExperienceSkills") %>'
DataSourceID="YearsofExperienceSkillsDDL" DataTextField="Value" DataValueField="ID">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:Button ID="insertButton" runat="server" CommandName="Insert"
Text="Insert" CssClass="btn-primary" ></asp:Button>
<asp:Button ID="insertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" CssClass="btn-primary" ></asp:Button>
</td>
</tr>
</table>
</InsertItemTemplate>
<ItemTemplate>
<table style="width:100%">
<tr>
<td class="col-md-6">
<asp:label class="link_sgray" id="FirstName" runat="server" >Skills: </asp:label>
<br />
<asp:Textbox style="width:100%" id="Skills" class="form-control" runat="server" Enabled="false"
Text='<%# Eval("Skills") %>'></asp:Textbox>
</td>
</tr>
<tr>
<td class="col-md-6">
<asp:label class="link_sgray" id="Label1" runat="server" >Proficiency: </asp:label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="Proficiency"
Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
<br />
<asp:DropDownList style="width:100%" id="Proficiency" CssClass="dropdown" runat="server" Enabled="false" selectedvalue='<%# Eval("Proficiency") %>'
DataSourceID="ProficiencyDDL" DataTextField="Value" DataValueField="ID">
</asp:DropDownList>
</td>
<td class="col-md-6">
<asp:label class="link_sgray" id="Label8" runat="server" >Years of Experience: </asp:label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="YearsofExperienceSkills"
Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
<br />
<asp:DropDownList style="width:100%" id="YearsofExperienceSkills" CssClass="dropdown" Enabled="false" runat="server" selectedvalue='<%# Eval("YearsofExperienceSkills") %>'
DataSourceID="YearsofExperienceSkillsDDL" DataTextField="Value" DataValueField="ID">
</asp:DropDownList>
</td>
<%----%>
</tr>
<tr>
<td>
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="True" CommandName="Edit" Text="Edit" CssClass="btn-primary" />
<asp:LinkButton ID="DeletelButton" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" CssClass="btn-primary"/>
</td>
</tr>
</table>
</ItemTemplate>
</asp:FormView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:SqlDataSource ID="ProficiencyDDl" runat="server" ConnectionString="<%$ ConnectionStrings:crms%>"
SelectCommand="SELECT [ID]
,[Value]
FROM [dbo].[StringMap]
where [AttributeName]='Proficiency' "> </asp:SqlDataSource>
<asp:SqlDataSource ID="YearsofExperienceSkillsDDl" runat="server" ConnectionString="<%$ ConnectionStrings:crms%>"
SelectCommand="SELECT [ID]
,[Value]
FROM [dbo].[StringMap]
where [AttributeName]='Years of Experience Skills' "> </asp:SqlDataSource>
<%----%>
<asp:sqldatasource id ="FormViewskillsSDS" runat="Server" ConnectionString="<%$ ConnectionStrings:crms%>"
SelectCommand="
SELECT SkillsID,
[Skills] ,
[Proficiency] ,
[YearsofExperienceSkills]
FROM Skills
inner join StringMap SMSP on SMSP.ID= Skills.Proficiency
and SMSP.AttributeName='Proficiency'
inner join StringMap SMYOES on SMYOES.ID= Skills.YearsofExperienceSkills
and SMYOES.AttributeName='Years of Experience Skills'
where ApplicantID=@ApplicantID and
SkillsID= @SkillsID
"
InsertCommand="Insert into [Skills] ( Skills ,
Proficiency ,
YearsofExperienceSkills
, ApplicantID ) VALUES ( @Skills, @Proficiency , @YearsofExperienceSkills , @ApplicantID); select @SkillsID = SCOPE_IDENTITY() "
DeleteCommand="DELETE FROM [Skills] WHERE [SkillsID] = @SkillsID"
UpdateCommand="UPDATE Skills
SET
Skills= @Skills
,Proficiency= @Proficiency
, YearsofExperienceSkills= @YearsofExperienceSkills
WHERE ApplicantID = @ApplicantID and
SkillsID= @SkillsID">
<SelectParameters>
<asp:SessionParameter Name="ApplicantID" Type="Int32" SessionField="ApplicantID" />
<asp:Parameter Name="SkillsID" Type="Int32" />
</SelectParameters>
<InsertParameters>
<asp:ControlParameter Name="Skills" ControlID="Formviewskills$Skills" Type="string" PropertyName="Text" />
<asp:ControlParameter Name="Proficiency" ControlID="Formviewskills$Proficiency" Type="int32" PropertyName="SelectedValue" />
<asp:ControlParameter Name="YearsofExperienceSkills" ControlID="Formviewskills$YearsofExperienceSkills" Type="int32" PropertyName="SelectedValue" />
<asp:SessionParameter Name="ApplicantID" Type="Int32" SessionField="ApplicantID" />
<asp:parameter Direction="Output" Name="SkillsID" Type="Int32" />
</InsertParameters>
<DeleteParameters>
<asp:SessionParameter Name="SkillsID" Type="Int32" SessionField="SkillsID" />
</DeleteParameters>
<UpdateParameters>
<asp:ControlParameter Name="Skills" ControlID="Formviewskills$Skills" Type="String" PropertyName="text"/>
<asp:ControlParameter Name="Proficiency" ControlID="Formviewskills$Proficiency" Type="int32" PropertyName="SelectedValue" />
<asp:ControlParameter Name="YearsofExperienceSkills" ControlID="Formviewskills$YearsofExperienceSkills" Type="int32" PropertyName="SelectedValue" />
<asp:SessionParameter Name="ApplicantID" Type="Int32" SessionField="ApplicantID" />
</UpdateParameters>
</asp:sqldatasource>
and the dynamically code add in the page load of main page is
Session["FormMode"] = false;
da = new SqlDataAdapter("select SkillsID from Skills Where ApplicantID='" + ApplicantID + "'", con);
con.Open();
ds = new DataSet();
da.Fill(ds, "Jobs");
DataTable SkillsTable = ds.Tables[0];
if (SkillsTable.Rows.Count > 0)
{
int i = 1;
foreach (DataRow row in SkillsTable.Rows)
{
DataColumn col = SkillsTable.Columns["SkillsID"];
Session["SkillsID"] = row[col].ToString();
HtmlGenericControl DivSkills = new HtmlGenericControl("div");
DivSkills.Attributes.Add("class", "class=panel - body");
DivSkills.Attributes.Add("id", (i).ToString());
Skillspnl.Controls.Add(DivSkills);
System.Web.UI.UserControl uc3 = (System.Web.UI.UserControl)Page.LoadControl("~/JobSeeker/skills.ascx");
FormView SkillsFV = uc3.FindControl("Formviewskills") as FormView;
SkillsFV.DefaultMode = FormViewMode.readonly;
SqlDataSource SqlSkills = uc3.FindControl("FormViewskillsSDS") as SqlDataSource;
SqlSkills.SelectParameters["SkillsID"].DefaultValue = row[col].ToString();
SqlSkills.DataBind();
DivSkills.Controls.Add(uc3);
i++;
}
}
|
|
|
|
|
|
OK
modified 6-Apr-17 12:30pm.
|
|
|
|
|
Right-click the project in the Solution Explorer, and choose Add->Reference. You should be able to figure out the dialog box from there.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Message Closed
modified 6-Apr-17 12:27pm.
|
|
|
|
|
Try rebuilding the project(s) that contains the types you are looking for.
Otherwise you're going to have to provide a lot more information. We can't see your screen or your projects to know what's wrong.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Message Removed
modified 2-Sep-16 14:29pm.
|
|
|
|
|
Hi All,
I deployed my asp.net application to IIS7 on server while loading data I am getting below error.
SQL1159 Initialization error with DB2 .NET Data Provider, reason code 7, tokens 9.5.4.DEF.2, SOFTWARE\IBM\DB2\InstalledCopies
StackTrace : at IBM.Data.DB2.DB2ConnPool.Open(DB2Connection connection, String& szConnectionString, DB2ConnSettings& ppSettings, Object& ppConn)
at IBM.Data.DB2.DB2Connection.Open()
====================================================
i compiled my application in 32bit machine and server is 64bit machine.
I did multiple setting in IIS like
1. "Enable 32bit application"
2. %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
3. Copying dll manually to GAC/C:windows/Assembly folder
4. Given full permission to sqllib folder.
5. I also tried changing to NetworkService.
not sure but still its giving above error.
Do i need to install 32 bit IBM Db2.net provider??
as 64 bit provider already installed on server.
Per my analysis do i need to install "IBM Data ServerProvider for .NET "??
Please advice i tried almost every solution .
Thanks
|
|
|
|
|
Tej_dev wrote: Please advice i tried almost every solution .
Did you try posting your problem in an appropriate forum? I don't see how this is anyway related to a C# issue. This appears to be an IIS or database administration problem and nothing to do with this forum.
|
|
|
|
|
If your application is compiled 32-bit it can ONLY work with 32-bit libraries, such as DB2.
If all you have on the server is the 64-bti DB2 client and provider, your application MUST be compiled as AnyCPU or explicitly as a 64-bit app. I would highly suggest switching it to explicitly 64-bit.
|
|
|
|
|
I am still having same issue , i compiled my application on 64 bit machine added 64bit IBM.data.Db2 dll and deployed code on IIS7
getting same error. please advice
Exception Message :SQL1159 Initialization error with DB2 .NET Data Provider, reason code 7, tokens 9.5.4.DEF.2, SOFTWARE\IBM\DB2\InstalledCopies
StackTrace : at IBM.Data.DB2.DB2ConnPool.Open(DB2Connection connection, String& szConnectionString, DB2ConnSettings& ppSettings, Object& ppConn)
at IBM.Data.DB2.DB2Connection.Open()
at DataAccessLayer.DataAccessLayer.getSourceDataDetails(String sourceDatabaseName)
at BusinessLayer.BusinessLayer.GetSourceDBUserNames(String sourceDatabaseName)
|
|
|
|
|
You don't have to compile it on a 64-bit machine. You DO have to go into the Project Properties, Build tab, and make sure that "Platform target" is set to "x64".
After that, you have to make sure your connection string, as deployed onto the server, is accurate.
|
|
|
|
|
I am new in EF. I mostly use ADO.Net to interact with DB. So learning EF code first.
Just see a below code. Post and blog class which has one-to-many relation I guess...........am I right?
public class Blog
{
public int BlogId { get; set; }
public string Name { get; set; }
public virtual List<Post> Posts { get; set; }
}
public class Post
{
public int PostId { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public int BlogId { get; set; }
public virtual Blog Blog { get; set; }
}
why blog class has one virtual property list type of Post?
And same way why post class has one virtual property type of Blog?
if we remove the virtual keyword only then what will happen?
how virtual keyword create relation?
why virtual keyword has been used in two class?
Please answer my all questions point wise in details.
tbhattacharjee
|
|
|
|
|
Did you even bother reading the answers the last time you posted about this[^]?
This space for rent
|
|
|
|