15,886,919 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 amsainju (Top 65 by date)
amsainju
22-Jun-13 9:27am
View
Thank you alot for your help. I will check into it.. thank you
amsainju
21-Jun-13 13:35pm
View
Thank you I tried the same thing but its not working for me while testing I found that nAlphaLocation get the value -1. m_ProgamID is getting value 1. should m_ProgramID be the one which is assigned the return of glCreateProgram(); I am using the same thing but can't figure out why it is not working for me
amsainju
21-Jun-13 8:23am
View
ohh... so Everytime a User change a value the shader will receive the value and render accrodingly?? or it will just be a 1 time effect. can u please explain how..
Thank you
amsainju
16-May-13 4:33am
View
I figured out that.. the problem is with compile as common Language Runtime Support(/clr) enable... i tried testing with small console application and found that with clr enable the truncated error is seen and with clr disabled the error is gone.. but i need the solution with clr support. still don't know what to do.
amsainju
16-May-13 3:03am
View
that too returns the samme bug... only the part of the whole string is assigned to the character pointer. even direct assigning is not working.
My tests are
const char *test2=
"Hello everyone"
"Please help me"
"my string assigning part to char pointer in a code is not working"
"I have been stucked on it for 3 days."
"I tried lot of things"
"but the problem persists."
"I have no idea why the code is not working"
" Here comes The problem in next line..."
"If you get this line in the up assigning variable..yuppieee";
const char *test3="Hello everyone .Please help me my string assigning part to char pointer in a code is not working I have been stucked on it for 3 days. I tried lot of things but the problem persists. I have no idea why the code is not working Here comes The problem in next line... If you get this line in the up assigning variable..yuppieee";
Result in
test2 ="Hello everyonePlease help memy string assigning part to char pointer in a code is not workingI have been stucked on it for 3 days.I tried lot of thingsbut the problem persists.I have no idea why the code is not working Here comes The problem in next line.."
test3 ="Hello everyone .Please help me my string assigning part to char pointer in a code is not working I have been stucked on it for 3 days. I tried lot of things but the problem persists. I have no idea why the code is not working Here comes The problem in nex"
only first 256 character is assinged to the variable.
amsainju
15-May-13 22:09pm
View
i tried it with two ways.
given below:
std::string str=
"attribute vec4 Position;\n"
"attribute vec2 TexCoord;\n"
"varying vec2 vTexCoord;\n"
"uniform float ScrollOffset;\n"
"uniform float Depth;\n"
"void main()\n"
"{\n"
" vTexCoord = TexCoord;\n"
" vTexCoord.s = vTexCoord.s * 0.125 + ScrollOffset;\n"
" gl_Position = Position;\n"
" gl_Position.z = Depth;\n"
"}\n";
const char *test= str.c_str();
char * writable = new char[str.size() + 1];
std::copy(str.begin(), str.end(), writable);
writable[str.size()] = '\0';
both test and writable character pointer stored truncated string of the real str string.
that is:
Result is given below
test= writable= "attribute vec4 Position;
attribute vec2 TexCoord;
varying vec2 vTexCoord;
uniform float ScrollOffset;
uniform float Depth;
void main()
{
vTexCoord = TexCoord;
vTexCoord.s = vTexCoord.s * 0.125 + ScrollOffset;
gl_Position = Position;
gl_Posi "
not whole data is assigned to test and writable (char pointer) variables. this time i did it with little simple method but the result is same
amsainju
15-May-13 4:35am
View
but unfortunately it works fine for 32 bit system.. thats bugging me.. if it had some misinterpreting character, it should had failed in 32 bit compile too.
amsainju
15-May-13 3:30am
View
I tried other methods too but the result is same.. thank you for your consideration.
amsainju
15-May-13 3:29am
View
no idea... i am not being able to figure out why only part of the total string is assigned.
amsainju
11-Dec-12 4:46am
View
Thank you for your support
amsainju
9-Oct-12 5:11am
View
Thank you for your help
amsainju
8-Oct-12 7:55am
View
thank you for your help I will try to solve the problem
amsainju
8-Oct-12 7:35am
View
how can i check if there is a client request ?
amsainju
18-Mar-12 11:21am
View
Actually my idea was to sort a paged gridview. for an example my table ins tblForum with topicName and NumberofComment as an attribute. and with 26 records in the table and i have pagged the gridview to show only 5 records in one page.
suppose my first page displays topic name from a to e and there are records of topicname from a to z in the table. now if i click topicName the sorting should occur in e to a not in the form z to v in the first page. In summary i want to sort only the content of the page that is displayed. I hope i made my problem more clear. thank you for your reply
amsainju
22-Dec-11 6:29am
View
ya this is a good answer...
amsainju
2-Dec-11 7:03am
View
ya inline messaging could be better than messagebox
amsainju
2-Dec-11 7:02am
View
yes in case of the albert comment...yes sometime the user have to know what was wrong with their input and providing the example of the valid inputs or inputs that are not acceptable should be shown to the user for the better understanding of the program by the user. thank u
amsainju
29-Nov-11 2:33am
View
yes thanks
amsainju
29-Nov-11 2:29am
View
yes it must depend on the situation... if a text box should be filled with numeric data then i prefer to not giving right for user to enter alphabet or other character.. i added my question for the justification of my solution..
thanks
amsainju
20-Nov-11 4:00am
View
will it be a good programming practice?
amsainju
20-Nov-11 3:53am
View
i know what it does.. it is used for making better looks of the interface design... but i was unable how to install it in vs2008. now i know ho to install it
amsainju
5-Nov-11 7:41am
View
thank you for your help
amsainju
5-Nov-11 7:41am
View
thank u for your help.
amsainju
22-Oct-11 9:18am
View
thanks i never thought to make change in program.cs thank u very much now i will try it
amsainju
22-Oct-11 9:11am
View
sorry i didn't understand u. i have never tried #if...i tried it but it produced more problems
amsainju
22-Oct-11 9:05am
View
frmEntrySecretKey is my first form..
i tried doing in this way but it also didn;t helped
public partial class frmEntrySecretKey : Form
{
public frmEntrySecretKey()
{
InitializeComponent();
initialevent();
}
public void initialevent()
{
string sk = BllLoginHelper.checkSecretKeys();
if (sk == null)
{
frmLogin frmlogin = new frmLogin();
frmlogin.Show();
this.Hide();
}
else
{
MessageBox.Show("there is A KEY");
}
}
amsainju
14-Oct-11 5:51am
View
how can we program the barcode for different key?
amsainju
12-Oct-11 12:23pm
View
ya maybe i am not a pro..just learning so can't properly explain sorry... but i got my answer
amsainju
12-Oct-11 11:53am
View
thanks pal....u solved my big problem...thanks alot...
amsainju
30-Aug-11 14:23pm
View
thank you for your help i will work out on it...if u have some refrence database can u send it to me in amsainju@gmail.com or arpan_s@hotmail.com..
thank u again
amsainju
25-Aug-11 10:55am
View
public static void insertNewStudent(string name,string clas,string section )
{
int STATUS;
SqlConnection con = GetConnection.getcon();
string qry = "insert into tbl_student(stud_name,stud_class,stud_section) values( @name,@clas,@section)";
SqlCommand cmd = new SqlCommand(qry, con);
cmd.Parameters.AddWithValue("@name", name);
cmd.Parameters.AddWithValue("@clas", clas);
cmd.Parameters.AddWithValue("@section", section);
STATUS= cmd.ExecuteNonQuery();
if (con.State == ConnectionState.Open)
{
con.Close();
}
}
public static string getId()
{
string stud_id=null;
SqlConnection con = GetConnection.getcon();
string qry = "select @@IDENTITY";
SqlCommand cmd = new SqlCommand(qry, con);
SqlDataReader sdr = cmd.ExecuteReader();
while (sdr.Read())
{
stud_id = sdr. ; //??????????????
break;
}
if (con.State == ConnectionState.Open)
{
con.Close();
}
return stud_id;
}
am i doing it right?? i can't figure out how i can retrive the data from sdr..
help
amsainju
25-Aug-11 10:52am
View
it didn't work it said error near LAST_INSERT_ID
amsainju
25-Aug-11 10:51am
View
Deleted
public static void insertNewStudent(string name,string clas,string section )
{
int lastid;
SqlConnection con = GetConnection.getcon();
// string qry = "insert into tbl_jewlName(jewl_name) values('"+name+"')";
string qry = "insert into tbl_student(stud_name,stud_class,stud_section) values( @name,@clas,@section)";
SqlCommand cmd = new SqlCommand(qry, con);
// SqlCommand cmd = new SqlCommand("insert into tbl_student(stud_name,stud_class,stud_section) values( '"+name+"','"+clas+"','"+section+"');LAST_INSERT_ID();", con);
cmd.Parameters.AddWithValue("@name", name);
cmd.Parameters.AddWithValue("@clas", clas);
cmd.Parameters.AddWithValue("@section", section);
lastid = cmd.ExecuteNonQuery();
// lastid = (int)cmd.ExecuteScalar();
if (con.State == ConnectionState.Open)
{
con.Close();
}
// return lastid;
}
public static string getId()
{
string stud_id=null;
// int studid;
SqlConnection con = GetConnection.getcon();
string qry = "select @@IDENTITY";
SqlCommand cmd = new SqlCommand(qry, con);
SqlDataReader sdr = cmd.ExecuteReader();
while (sdr.Read())
{
// count = 1;
// break;
stud_id = sdr. ;
break;
}
if (con.State == ConnectionState.Open)
{
con.Close();
}
// stud_id = studid.ToString();
return stud_id;
}
am i doing it right?? i can't figure out how i can retrive the data from sdr..
help
amsainju
25-Aug-11 10:37am
View
does it help with mssql..that was the reference for mysql
amsainju
24-Aug-11 15:50pm
View
thanks a lot
amsainju
24-Aug-11 15:15pm
View
amsainju@gmail.com
or
arpan_s@hotmail.com
these are my id try to send it again haii
amsainju
24-Aug-11 14:36pm
View
my mail id is amsainju@gmail.com....yee refrence would also be a great help....thank u...
amsainju
24-Aug-11 14:30pm
View
in sql i gave a hugeeee query i think that was the prob
i will try with a lil simple query this time hope it works
amsainju
24-Aug-11 14:24pm
View
i gave the path and the problem was solved but a new error came
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using Microsoft.Reporting.WinForms;
using System.Web;
//using Microsoft.ReportingServices.DataExtensions;
namespace cpreportviewer2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
TestDataSet.TestDataTable aa = GetReportData();
DisplayReport(aa);
this.reportViewer1.RefreshReport();
}
public static TestDataSet.TestDataTable GetReportData()
{
TestDataSetTableAdapters.TestTableAdapter ta= new TestDataSetTableAdapters.TestTableAdapter();
return ta.GetData();
// TestTableAdapters.TestTableAdapter ta = new TestTableAdapters.TestTableAdapter();
// return ta.GetData();
}
public void DisplayReport(TestDataSet.TestDataTable dt)
{
try
{
if (dt != null)
{
String rptName = String.Empty;
rptName = "rptSummary.rdlc";
////Mapping the Path of the Report
// reportViewer1.LocalReport.ReportPath
// reportViewer1.LocalReport.ReportPath = MapPath(rptName);
reportViewer1.LocalReport.ReportPath = "C:\\Users\\Arpan\\Documents\\Visual Studio 2008\\Projects\\cpreportviewer2\\cpreportviewer2\rptSummary.rdlc";
ReportDataSource rds = new ReportDataSource();
rds.Name = "TestDataSet_Test";
rds.Value = dt;
reportViewer1.LocalReport.DataSources.Add(rds);
reportViewer1.LocalReport.Refresh();
}
}
catch (Exception oEx)
{
MessageBox.Show(oEx + "ShowReport");
}
}
}
}
am i doing it right??
the error was introduced in
line return ta.getData();
error:
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
amsainju
24-Aug-11 14:12pm
View
hey i did as u said... but the code show only one problem..
in the following line
reportViewer1.LocalReport.ReportPath = Server.MapPath(rptName);
the error is
the name Server does not exists in current context...
i am using these class libraries
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using Microsoft.Reporting.WinForms;
using System.Web;
the code after running asked to add Microsoft.SqlServer.Server but it also didn't solve the problem..
help me with this
ok thanks for your help
Server
amsainju
24-Aug-11 13:40pm
View
thank you for your kind help....i will try as u say....if i again encounter any problem, i will let u know thank you..
amsainju
16-Aug-11 21:47pm
View
+5
amsainju
16-Aug-11 21:47pm
View
good ans john
+5
amsainju
16-Aug-11 21:46pm
View
my too +5
amsainju
16-Aug-11 7:40am
View
if (dgvSearch.Rows.Count > 0)
{
dgvSearch.Rows.Clear();
dgvSearch.Rows.Add(15);
}
i had forgetten to use dgvSearch.Rows.Add(15); in my code
the error was shown because dgvSearch.Rows.Clear() clears or say deletes all the empty rows that i used for a better design...
thank u all for your help
amsainju
16-Aug-11 2:40am
View
ya not working in windows application :(
amsainju
16-Aug-11 2:37am
View
it didn't worked :(
amsainju
16-Aug-11 2:33am
View
there is no such property such as datbind in c#...
amsainju
16-Aug-11 2:12am
View
hey sorry john i was just testing what these voting does.
amsainju
16-Aug-11 0:32am
View
i tried dgvSearch.Clear() too but it didn't helped...i am still nowhere.
amsainju
15-Aug-11 14:42pm
View
i tried to use that but when i executed the program it showed this problem
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
in this part of the code:
dgvSearch.Rows[j].Cells[0].Value =table.Rows[j].ItemArray[0].ToString();
amsainju
15-Aug-11 14:36pm
View
so any ideas???
amsainju
15-Aug-11 14:25pm
View
i heard that databind is not necessory in c# it is only used in asp.net..... and i have seen the property named databind in c#..so what should i do
amsainju
19-Jul-11 6:16am
View
i reached to a good link surfing through them thanks for ur help
amsainju
19-Jul-11 6:14am
View
hi,
i didn't get it...
how this could disable the selection of the cell if the cell is null
amsainju
5-Jun-11 22:00pm
View
the code didn't showed any problem in it..i rechecked my steps with the given steps in the tutorial but i did exactly what stated in the tutorial....
though i use c# but the code was given in vb so i used converter to change the vb code to c#
this is the website i used for the conversion
http://www.developerfusion.com/tools/convert/vb-to-csharp/
In the code,
private void ExecuteSql(string DatabaseName, string Sql)
{
System.Data.SqlClient.SqlCommand Command = new System.Data.SqlClient.SqlCommand(Sql, masterConnection);
// Initialize the connection, open it, and set it to the "master" database
masterConnection.ConnectionString = My.Settings.masterConnectionString;
Command.Connection.Open();
Command.Connection.ChangeDatabase(DatabaseName);
try {
Command.ExecuteNonQuery();
} finally {
// Closing the connection should be done in a Finally block
Command.Connection.Close();
}
}
but this line didn't worked i think due to the framework version compatible issues...
masterConnection.ConnectionString = My.Settings.masterConnectionString;
....
it specified the error as "the name 'My' is not in the context"
so i changed the code with
masterConnection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["dbCustomAction.Properties.Settings.masterConnectionString"].ToString();
adding a refrence of system.Configuration
so this code didn't showed any problem...
now i don't know where specifically my problem resides...
can you now help me with this??
amsainju
5-Jun-11 21:16pm
View
thanks for the suggestion..i will check it out again
amsainju
5-Jun-11 14:25pm
View
hey i visited
http://msdn.microsoft.com/en-us/library/49b92ztk%28v=VS.90%29.aspx#Y1075
for my solution i did as stated in the page with little modification in the code to manange the problem that occur with different version of .net framework...
at the end the whole code didn't show any error but when i executed the output the following error occured in the middle of the execution
Error 1001.Object reference not set to an instance of an object
if you like to see the code i did i can send you in your email...
amsainju
5-Jun-11 11:29am
View
do you have any example can you send it to me in amsainju@gmail.com
thanks for your support
amsainju
5-Jun-11 10:16am
View
thank u...for the help :-)
amsainju
5-Jun-11 10:12am
View
thanks for the links i will check it out...thank u
amsainju
5-Jun-11 10:10am
View
yes my friends computer has the sql server installed in it...where can i get the tutorial for learning to create the database in the installation
amsainju
5-Jun-11 10:07am
View
i have given the code i used to connect to the database....
i want my installation of the program to create a database for itself...i searched alot for the soln but i can't figure it out...the installion file of my program doesn't create the database and the connection string in the app.config file is still same as in my computer...i think it should change with the change in computer because the datasource changes with the computer..
please help me with this
thanks for your concern
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace trydb.dll
{
class dllsqlhelper
{
public string getconstr()
{
string constr = System.Configuration.ConfigurationManager.ConnectionStrings["trydb"].ToString();
return constr;
}
public int insertUserInfo(string user, string pass)
{
// string res;
int i=0;
SqlConnection con = new SqlConnection();
con.ConnectionString = getconstr();
string sql = "insert into tbluser([username],[password]) values('" + user + "','" + pass + "')";
SqlCommand cmd = new SqlCommand(sql, con);
con.Open();
try
{
i = cmd.ExecuteNonQuery();
// res="sucess";
}
catch (Exception ex)
{
// res= "failure";
throw;
}
finally
{
con.Close();
}
return i;
}
}
}
amsainju
5-Jun-11 10:02am
View
how can we create a new database using c#... the connectionstring requires the data source name
amsainju
5-Jun-11 10:00am
View
i am using mssql server 2005...
my connectionstring is "Data Source=ARPAN-PC;Initial Catalog=dbtry;User ID=ARPAN;"
I Created a setup file for my program and installed the program in my friend's computer...i wanted to see if that installation would create a new database for the new installation in my friends computer...but it didn't created a new database also i check out the app.config file the conncetionstring was same as above given..
Show More