|
havent done sockets before. i am juat
asking for help from those with knowledge.
Server should mantain filename, file type,
filesize, dateof upload and number of
downloads and this information should be in
a database. Client should be Windows forms
and Server should be Console.<pre lang="c#"></pre> havent done sockets before. i am juat
asking for help from those with knowledge.
Server should mantain filename, file type,
filesize, dateof upload and number of
downloads and this information should be in
a database. Client should be Windows forms
and Server should be Console.
|
|
|
|
|
|
Hey,
i have some .swf decompiled and i can see all the .as files in it.
so now i want to edit some variable in for example i want to edit the variable "x" in
main.as
so i loaded the swf and when i want to setVariable I get the error:
"Error HRESULT E_FAIL has been returned from a call to a COM component."
you know how can I get the variable and change it?
*Im using AxShockwaveFlashObjects and ShockwaveFlashObjects
|
|
|
|
|
Don't repost your question again and again all over the site. Once is enough.
I've never heard of anyone doing what you're attempting, so I can't comment on it.
|
|
|
|
|
Ok, Sorry about the reposting , Im new and I thought I posted in the worng place.
|
|
|
|
|
hi,
I wanted to ask is there a universal api to connect to any or to many databases from MySQL, MS SQL to Oracle, etc without having to change the sqlConnection, sqlCommand, etc for every different database?
I am asking this question because my application will hjave an option to connect to MS SQL, MySQL or Oracle.
Please advise...
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
Yeah, it's called ODBC.
The problem with it is that it's not optimized to connect to any one database type, and hence, performance suffers a bit.
The way it's normally done is you create a database provider layer for your application supporting the connection to the database type that's chosen. This is where a tiered application design approach comes in.
|
|
|
|
|
Jassim Rahma wrote: without having to change the sqlConnection, sqlCommand, etc for every different database? That's why we have the IDbConnection interface; it hardly matters which DbConnection you use. There's a CodeProject article with details here[^], and there's details on MSDN[^].
Alternatively, you could look into a product like DotConnect[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello,
How can we grab the values of the checked checkboxes when click on the button.
Here is code we have:
asp:
<asp:Repeater runat="server" ID="rptCandidats" >
<ItemTemplate>
<div>
<asp:checkbox id="chResponse" runat="server" /></asp:checkbox>
<%# Eval("ResText")%>
</div>
</ItemTemplate>
</asp:Repeater>
<asp:LinkButton ID="BtnVote" runat="server" Text="Vote" CssClass="btn" OnClick="BtnVote_Click" />
And c#:
protected void Page_Load(object sender, EventArgs e)
{
rptCandidats.DataSource = CUtil.GetResponses();
rptCandidats.DataBind();
}
Any suggestions are appreciated.
Thanks.
|
|
|
|
|
First problem: you're re-binding the list on every load. This will clear the checked checkboxes. You need to wrap your binding code in an if (!IsPostBack) block:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
rptCandidats.DataSource = CUtil.GetResponses();
rptCandidats.DataBind();
}
}
Second problem: Your checkboxes don't have any values, and the Repeater control doesn't support the DataKey properties which would allow you to store arbitrary values against each item.
If you just want to return the value of the ResText field, it's fairly simple: bind the Text property of the CheckBox control to the ResText field, and return that. (This will also improve accessibility, since it will render a <label> for each CheckBox .)
<asp:Repeater id="rptCandidats" runat="server">
<ItemTemplate>
<div>
<asp:CheckBox id="chResponse" runat="server"
Text='<%# Eval("ResText") %>'
/>
</div>
</ItemTemplate>
</asp:Repeater>
List<string> selectedItems = new List<string>(rptCandidats.Items.Count);
foreach (RepeaterItem item in rptCandidats.Items)
{
CheckBox checkbox = (CheckBox)item.FindControl("chResponse");
if (checkbox.Checked)
{
selectedItems.Add(checkbox.Text);
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
Interface and abstract class why we use please explain
|
|
|
|
|
|
Because it is a smart thing to do.
Both allow you to stub out or define aspects of a class that you may know but not completely or you may not be the one ultimately filling in the functionality.
Interfaces allow you to specify what properties, methods, and events MUST be present on an object that conforms to that interface. Take, for example, INotityPropertyChanged. If an object implements that interface, then it MUST expose a PropertyChanged event with a specific signature. When another object wants to be notified that a property changed, it can inspect the target class to see if that interface is implemented and if so, hook the event. Because now you know what the event name and signature must be.
Interfaces, however, only specify the properties, events, and methods that a class must expose and a class may implement more than one interface. Abstract classes, however, have a bit more meat on their bones. They are actual classes but simply stub the method functionality leaving it to be implemented in a class that inherits from the abstract class. A good example might be a data access object that exposes some data stored in the database. You would define an interface for the class including the methods needed to get and save data. You might then create an abstract class that provides some basics but doesn't include any details on how to get to the database. Finally, you might create two or three concrete classes from the abstract class that each know how to connect to a specific database server... maybe one for SQL, another for Oracle, and a 3rd for NoSQL. At runtime you can use reflection to find the proper concrete class and load it. Your code works with only the interfaces but at runtime is provided with the concrete instance of the appropriate class.
HTH!
Jason
|
|
|
|
|
No.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Hi Guys,
Im trying to retrieve a part of a string (a filepath and name) from a field.
However when I do, c# "helpfully" automatically escapes the string.
So instead of the string: C:\folderpath\filename.doc
I end up with: C:\\folderpath\\filename.doc
I've tried using the string.Replace funciton to remove the extra rubbish, but nothing happens.
I've also tried using Regex, but it just complains that it doesnt know what "\f" is.
I've tried adding "@" to the beginning of the string retrieval, but that doesnt help either.
Im running a sql query
using (SqlCommand cmd = new SqlCommand("Select Address1, Address2, LinkedDoc, Recid from Contsupp2 Where Rectype = 'L' AND U_ADDRESS1 Like @param", conn))
{
cmd.Parameters.Add("param", SqlDbType.VarChar,10).Value = @"S:\RWE%";
using (SqlDataReader reader = cmd.ExecuteReader())
{
txt.Clear();
while (reader.Read())
{
string strOrigFilePath = (reader.GetString(2).Substring(reader.GetString(2).IndexOf("FILENAME=") + 9));
Any suggestions as to how I can return a normal string without c# messing it up?
Thanks
|
|
|
|
|
If you're viewing the value in the debugger, it will automatically be shown as an escaped string. The string itself doesn't contain the extra escape characters.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi all,
I am looking for a way to Autofill or auto generate a Bank Transfer form like this
I have a template in word now that i autofill using data i pull from an SQL DB but the problem is that the text in te letter isnt always the same size so or the data on the Transfer is lower or higher so i need another way to add the transfer form at the end of the letter
Is there a DLL available somewhere or a site where i can get info on programming this stuff.
Any help is welcome
kind regards,
Michiel
|
|
|
|
|
when is the "this" refference used when creatinga c#.net application?
|
|
|
|
|
|
What I am trying to do:
I want to add a combobox to the datagridview , with some three items ,like a,b,c, and a last item to be : new, when the user seletcts the last item :new in the combobox , the combobox has to be removed or it should change to textbox allowing to enter a value.
Suggest me whichever is possible ,that should take a value.
|
|
|
|
|
Unlike the ComboBox control, the DataGridViewComboBoxCell does not have SelectedIndex and SelectedValue properties. Instead, selecting a value from a drop-down list sets the cell Value property.
MSDN: The drop-down list values (or the values indicated by the ValueMember property) must include the actual cell values or the DataGridView control will throw an exception. Based on above, I'd rather suggest to manage the items in the combo from a different place than the grid.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for the reply
|
|
|
|
|
hi , i have error in connection c# with oracle 11g express edition i put my connection string in app.config file "<add name="ConnectionString" connectionString="Provider=MSDAORA;Data Source=localhost;Password=LIB314;User ID=LIB_DB" providerName="System.Data.OleDb" />"
when i want to run a query it gives me error says "The 'MSDAORA' provider is not registered on the local machine" , i use windows 8.1 pro x64 ... any can help me please?
|
|
|
|