Quantcast
Channel: CSharp Forum Latest Questions
Viewing all 32759 articles
Browse latest View live

Can a asp.net developer do without javascript and jquery?

$
0
0
Hi,
In real time how important is javascript and jquery for a asp.net devloper? Can they entired do without it?

Windows registeries

$
0
0
 i have following small line of code

RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",true);
rkApp.SetValue(
"MyApp1", "C:\\WINDOWS\\myexe");


now when i run code in c# (desktop application ) it make changes in registeries and .exe run when system start ..but the problem is whne i make setup and deploymemt of same code and deploy on server ..and install desktop application on server ..it does not make any entries .. any help
do let me know when further EXPLANATION is required ...

let me share one more thing the same issue ocurring via setup/deployment on my machine ..I mean via an exe it creating problem on my machine too ..but whne i make entries via code its work FINE ..


Asp.net / C#: How to get the right resource from a class lib

$
0
0
I have a web application written with C#/ASP.NET that use a Class Library to Get, Insert & Update information.
This is application runs with 2 different language: English & French.

Once the user logged in, I can detect his culture (already stored in db) and it displays correctly french/english labels correctly by retrieving the right resource file.

In the Class Library (.dll), I added 2 Resource Files for French & English version to return error message based on the user culture.


**So my problem is when I try to update user profile and the culture is french, and in the "Address" field is empty the system keeps returning the english message no matter the user culture**




**Here's a snapshot from my Class Library (.dll)**

    public string Address1
        {
            get { return _Address1; }
            set
            {
                if (string.IsNullOrEmpty(value))
                {
                    // Error! The field « Address » is mandatory!");
                    throw new Exception(Resources.CTenant_Messages.Address1_Missing.ToString());
                }

                else if (value.ToString().Trim().Length > LibNamtek.Public.CConstant.LENGTH_300)
                {
                    // Error! The total length for « Address » exceeds " + LibNamtek.Public.CConstant.LENGTH_300.ToString() + " caracters.");
                    throw new Exception(Resources.CTenant_Messages.Address1_Length.ToString().Replace("[LENGTH]", LibNamtek.Public.CConstant.LENGTH_300.ToString()));
                }
                else
                {
                    _Address1 = value;
                }
            }
        }


        public DataSet UpdateUser()
        {
            string v_connection_string = CConnection.GetDBConnection();
            SqlConnection v_connection = new SqlConnection(v_connection_string);

            try
            {
                // Open Connection
                v_connection.Open();

                SqlCommand cmd = new SqlCommand("pr_update_user", v_connection);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.Add("@p_user_id", SqlDbType.Int);
                cmd.Parameters["@p_user_id"].Value = this.UserId;

                cmd.Parameters.Add("@p_name", SqlDbType.NVarChar);
                cmd.Parameters["@p_name"].Size = LibNamtek.Public.CConstant.LENGTH_300;
                cmd.Parameters["@p_name"].Value = this.Name;

                cmd.Parameters.Add("@p_address1", SqlDbType.NVarChar);
                cmd.Parameters["@p_address1"].Size = LibNamtek.Public.CConstant.LENGTH_300;
                cmd.Parameters["@p_address1"].Value = this.Address1;;

                cmd.Parameters.Add("@p_address2", SqlDbType.NVarChar);
                cmd.Parameters["@p_address2"].Size = LibNamtek.Public.CConstant.LENGTH_300;
                cmd.Parameters["@p_address2"].Value = (this.Address2 == LibNamtek.Public.CConstant.DEFAULT_STRING ? DBNull.Value : (object)this.Address2);

                cmd.Parameters.Add("@p_city", SqlDbType.NVarChar);
                cmd.Parameters["@p_city"].Size = LibNamtek.Public.CConstant.LENGTH_300;
                cmd.Parameters["@p_city"].Value = this.City;

                cmd.Parameters.Add("@p_province", SqlDbType.NVarChar);
                cmd.Parameters["@p_province"].Size = LibNamtek.Public.CConstant.LENGTH_300;
                cmd.Parameters["@p_province"].Value = this.Province;

                cmd.Parameters.Add("@p_country_id", SqlDbType.Int);
                cmd.Parameters["@p_country_id"].Value = this.CountryId;

                cmd.Parameters.Add("@p_postal_code", SqlDbType.NVarChar);
                cmd.Parameters["@p_postal_code"].Size = LibNamtek.Public.CConstant.LENGTH_30;
                cmd.Parameters["@p_postal_code"].Value = this.PostalCode;

                cmd.Parameters.Add("@p_phone1", SqlDbType.NVarChar);
                cmd.Parameters["@p_phone1"].Size = LibNamtek.Public.CConstant.LENGTH_30;
                cmd.Parameters["@p_phone1"].Value = this.Phone1;

                cmd.Parameters.Add("@p_fax", SqlDbType.NVarChar);
                cmd.Parameters["@p_fax"].Size = LibNamtek.Public.CConstant.LENGTH_30;
                cmd.Parameters["@p_fax"].Value = (this.Fax == LibNamtek.Public.CConstant.DEFAULT_STRING ? DBNull.Value : (object)this.Fax);

                cmd.Parameters.Add("@p_email", SqlDbType.NVarChar);
                cmd.Parameters["@p_email"].Size = LibNamtek.Public.CConstant.LENGTH_300;
                cmd.Parameters["@p_email"].Value = this.Email;

                cmd.Parameters.Add("@p_memo", SqlDbType.NVarChar);
                cmd.Parameters["@p_memo"].Value = (this.Memo == LibNamtek.Public.CConstant.DEFAULT_STRING ? DBNull.Value : (object)this.Memo);

                cmd.Parameters.Add("@p_system_date", SqlDbType.DateTime);
                cmd.Parameters["@p_system_date"].Value = this.SystemDate;

                cmd.Parameters.Add("@p_system_user", SqlDbType.NVarChar);
                cmd.Parameters["@p_system_user"].Size = LibNamtek.Public.CConstant.LENGTH_30;
                cmd.Parameters["@p_system_user"].Value = this.SystemUser;

                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataSet ds = new DataSet("UpdateTenant");
                da.Fill(ds);

                return ds;

            }

            catch (Exception ex)
            {
                throw ex;
            }

            finally
            {
                if (v_connection != null)
                {
                    v_connection.Close();
                }
            }
        }







 

How to know dynamically created chekboxes is selected or not

$
0
0
Hi All

I am trying to generated the dynamic labels depending on the checked checkboxes which are dynamically created.

My .Net frame is 3.5
Here is code for dynamic checkboxes

System.Windows.Forms.CheckBox[] checkBox = new System.Windows.Forms.CheckBox[bran_count];

            for (int i = 0; i < bran_count; ++i)
            {
                checkBox[i] = new CheckBox();
                checkBox[i].Name = "radio" + Convert.ToString(i);
                checkBox[i].Text = ds2.Tables[0].Rows[i][2].ToString();
                
                checkBox[i].Location = new System.Drawing.Point(125 * i, 15);
                groupBox1.Controls.Add(checkBox[i]);
                checkBox[i].CheckStateChanged += new System.EventHandler(CheckBoxCheckedChanged);
                
            }
        }
        private void CheckBoxCheckedChanged(object sender, EventArgs e)
        {
            //MessageBox.Show();
        }
Any guidance is welcome, if possible give some code snippet.
Regards

to show data from database on mouse over of a date

$
0
0
Hello All,

I want to show div with data from database table when i move mouse over a calendar's date means i want to show detailed event happening on that day when mouse is over that date.Please help.

Radio button not firing on first click

$
0
0
 

I have a nested gridview that I have a group of radio buttons on that are linked to answers for a question in the main gridview. When I first click on the radio button, it does a post back, but the selection does not change. If I click the button a second time it posts back and the click event fires.

How do I get the first click to fire the click event?

The nested gridview contains answers to a Question gridview. So when I get the questions, it fires the Stored Procedure to get the answers for that question. Since there is only one question per page, it has to fire on each new page. However, that is not the problem. As I said, I can retain the information, it is just a matter of making it select the chosen answer on the first click rather than having to click twice. When reviewing the questions and answers, if the question was answered, it is checked. However, to choose something else, it will post back and not change the selection or fire the click event for the radio button. However, after that, it will function correctly for any radio button choice. So the first time on the page it will post back when clicking the radio button, but will not change anything. Subsequently, it will make the appropriate change and fire the click event.

display multi locations in google maps within a windows appl

file system

$
0
0


Looking for ASP help
search for all folder with a particular name (eg: purchase) and displaying its contents.
there are muliple folders under this name in different folders.

I Need MVC3 Image Slider Wtih Use Database

$
0
0
using mvc technoloji and i need slider but i must use picture from database
i need this slider 

linq and looping

$
0
0
Sample data from table: Table Name - SUPPLIERS and Entity Name - dbData

RECORD_NO     ID_NO      FIRST_BRANCH     SECOND_BRANCH   POSITION
----------------------------------------------------------------
   1      05100242     05100243         05100244         L
   2       05200443     05100245         05100247         L
   3       05100244     05100248                          R
   4       05100245     05100249                           L
   5       05100247     05100250                           R
   6       05100248                                        L
   7       05100249                                        L
   8       05100250                                        L


if you get all the branch of 0510024, use the query 
int suppliers = dbData.SUPPLIERS.where(x=>x.RECORD_NO !=1).Count();

THE QUESTION IS HOW ARE YOU GOING TO GET THE SUPPLIERS(COUNT) OF 05100243 & 05100244 using query and loop OR ANY METHOD USE TO GET THE RESULTS?

TO GET THE RESULT OF 05100243 I used
var data = dbData.SUPPLIERS.where(x=>x.ID_NO == 05100243);
string left = data.FIRST_BRANCH;
var leftbranch = dbData.where(x=>x.ID_NO == left);
string right = data.SECOND_BRANCH;
var leftbranch = dbData.where(x=>x.ID_NO == right);



YOU CAN USE THAT METHOD BUT MANUALLY SPEAKING,YOU DID'NT KNOW HOW TO STOP AND HOW MANY ROWS BECAUSE IT IS INCREASING.


ANYONE WHO KNOWS THE SOLUTION FOR THIS? using a class that will count the left and right side?

modifying web.config during installation

$
0
0
Hello Friends,

I am working on VS 2010 > Setup and Deployment > Visual Studio Installer > Web Setup Project.

I used to take the database server name from user in the setup wizard. 
Once we get database server name from user we need to modify web.config connection string.

Can anybody please provide sample example or help link to modify web.config in Web Setup Project?

Thanks in advance!

Regards,
Atul Gaikwad

Adding Widgets in Desktop Application in C# code Behind

$
0
0
I would like to add Widgets Window into Desktop Dashboard tab...Any code or idea for adding that help....thankx in AddVance

C# widgets

$
0
0
I would like to add widgets in Desktop Dashboard application...Any idea of code or idea in C#???thankx in advance

How to display empty space in rdlc main report for Subreport

$
0
0
Hi,
      I am having a requirement to display empty space inside a main rdlc when its 2 subreports didn't return any rows. Kindly help me in this regard. As of now I am getting data for Main rdlc where as for 2 sub reports which dont have any data, its showing message as Data Retrieval failed,please chekck.....and so on.  Thanks in Advance.

Get the list of products through Wcf Service

$
0
0
Create a Product Table and OrderTable and clientid based on the clientid and productid- 
Get the list of products for which there is no order. Through WCf service. 

Jquery HIde unhide row of grid

$
0
0
How to show or hide/unhide row of grid view at UI level using JQuery?

 
Where we use JQuery and AJAX in our project?

Unable to get value from view to controller in MVC3

$
0
0
Hi ,

I am trying to generate a report using 2 dropdowns  country,process (2nd ddl is autopopulated on selection of 1st.) and two dates(from and to).
I used list<> (in model) for populating drodowns using jquery(in view).

I want to generate a report using the date fields for that particular country and process.
My controller is not getting any values from view and they are going null while trying to generate report.

Webcam image to SQL database

$
0
0
Hi,

I am working on an ASP.NET application, I have a page where i capture an image from the user's webcam and display that image on an image control.. How do i save this image in a database?


I've searched for many samples, but all i found is the fileupload code. I am not uploading the image here, but i'm capturing it from a webcam.

help me !!

converting a delimited string to xml

$
0
0

am a newbee in csharp and have to convert a delimited string into differnet structured xmls.string is in this format 2344|1111|2222

xml formats are <string>2344</string><string>1111</string><string>2222</string>

and <ItemType1><code>2344</code></ItemType1><ItemType1><code>1111</code></ItemType1><ItemType1><code>2222</code></ItemType1>

how this can be achieved in c sharp

how to Create Linear barcode crystal report my sql data fiel

$
0
0
how to Create Linear barcode crystal report my sql data field invoice id field in varchar field
Please provide the sample solution
Viewing all 32759 articles
Browse latest View live