|
Hi,
I am using Asp.Net 2.0 application, First i have created database dynamically in my codebehind. well the db created successfully. Now i want to give username and password dynamically for my dynamically created database. Is it possible? If yes, please tell me how can we do?
Try
Dim strQuery As String
strName = txtName.Value
strQuery = "create database db" & strName & ""
createDataBase(strQuery)
Catch ex As Exception
End Try
End Sub
'Function for create database
Function createDataBase(ByVal strQuery)
Try
Dim blnResults As Boolean = False
Dim intRowsAffected As Integer
ConOpen()
Try
objCmd = New SqlCommand
objCmd.Connection = objCnn
objCmd.CommandType = CommandType.Text
objCmd.CommandText = strQuery
intRowsAffected = objCmd.ExecuteNonQuery()
If intRowsAffected > 0 Then blnResults = True
Catch ex As Exception
createDataBase = ex.Message
'MsgBox(ex.Message)
Exit Try
Finally
ConClose()
End Try
Exit_Function:
createDataBase = blnResults
Catch ex As Exception
End Try
Return Nothing
End Function
The above one is created database dynamically in code behind. I need to create username and password dynamically in code behind.
Hope yours reply.
Every Successful Person Have A Painful Story
|
|
|
|
|
Hello Friends,
I'm establishing a connection between ASP.NET and MySql. But i'm getting following error
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Here i'm also providing my ConnectionString below
<connectionStrings>
<add name="ConnectionString" connectionString="Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=totalbhakti_new;uid=root;pwd=; />
</connectionStrings>
Actually MySql which is installed on my system is with PHP(using Wamp Server). Is that the reason behind throwing the error
|
|
|
|
|
If MySQL is on the local machine, I'd not have expected the DB to be tied to PHP, unless it's that the PHP server locks it somehow.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi to All,
What is Content Management System(CMS) & Knowledge Management System(KMS)?
how CMS relates with KMS?
Advandages & disadvandages of CMS & KMS??
Thanks,
NKMKrishna
|
|
|
|
|
nkmkrishna wrote: What is Content Management System(CMS)
Its is a system which manages content
nkmkrishna wrote: Knowledge Management System(KMS)
It is a system which manages Knowledge.
nkmkrishna wrote: how CMS relates with KMS?
Im guessing sometimes there is content associated with knowledge.
further reading[^]
|
|
|
|
|
Hello All,
I want to send image tag in Response.Write how can I achieve this..
I am doing like this
Response.Write(" ");
know the problem I have is I am giving creating multiple images, that should be at the location of control where I am using it.
But It is not working ....
Any suggestion what should i do.....
Thanks in advance
Regards
|
|
|
|
|
Try Single quote,
Response.Write(" <img alt='' src='Images/2.jpg' style='height: 37px; width: 40px' />");
This should work.
|
|
|
|
|
What are the main pain points of ajax. what are the point/decisions we need to consider before deciding to go for an ajax based framework in our application
|
|
|
|
|
Do you have a need for AJAX. That's it, really.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i want to export dataset at runtime to an excel file. i had tried but in vain. Pleaae help me with some link to work out.
Thnks in advance.
|
|
|
|
|
Hi Bhavna,
The requirement is fissible via Gridview control or XmlDocument
but I think your requirement is without gridview,
We need to do the requirement as below
DataSet DS = somevalueDataSet();
XmlDataDocument xdd = new XmlDataDocument(DS);
XslTransform xt = new XslTransform();
string workingdir = AppDomain.CurrentDomain.BaseDirectory + "/" + "xslSheet.xsl";
xt.Load(workingdir);
string dirPath = AppDomain.CurrentDomain.BaseDirectory + "/" + "GeneratedFR";
string filePath = AppDomain.CurrentDomain.BaseDirectory + "/" + "GeneratedFR" + "/" + "Test1.xls";
if (!Directory.Exists(dirPath))
{
Directory.CreateDirectory(dirPath);
}
File.Delete(filePath);
FileStream fs = new FileStream(filePath, FileMode.Create);
using(fs)
{
xt.Transform(xdd,null,fs);
fs.Close();
}
|
|
|
|
|
I Want to know about connect between asp page and sql sever.i Would like to know the varios ways to do that task.Give me any example coding about it.
please reply it me quickly.....
with regards
yrs che_karthik
|
|
|
|
|
che_kar wrote: I Want to know about connect between asp page and sql sever
This is very basic stuff. Please buy a good book on ASP.NET and work out the examples provided.
|
|
|
|
|
Dear all,
I want to develop a live broadcast program in asp.net with c#, but i have no any idea about web cam related program. I already work on streaming technology for video site.
if anybody have web cam related program in asp.net then please ping me.
Thanks,
Ashutosh Kumar Jha
ashutosh kumar jha
|
|
|
|
|
Hi, I am using a calendar control in my project. When i click on the date the control was post backed. My guide told to make the post back false. But thers is no post back property for that control. Can anyone tell how to achieve it?
|
|
|
|
|
Karthick_gc wrote: My guide told to make the post back false. But thers is no post back property for that control.
Your guide ? Is that like your boss ? There's no AutoPostBack property ? Perhaps you need a javascript calendar, the one built in to .NET kind of sucks.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Is there is any link to access the Javascript calendar?
|
|
|
|
|
Here[^]. Looks like you need to read this[^] article.
|
|
|
|
|
am using checkboxes to select rows in a gridview and once i click on the checkbox and click on transfer i want the selected rows to get displayed in another gridview..
heres the code .. but am getting Input array is longer than the number of columns in this table error message..
am stuck here...
DataTable dt = new DataTable();
foreach(GridViewRow dgr in GridView1.Rows)
{
if(((CheckBox)(dgr.FindControl("chkbx"))).Checked==true)
{
dt.Rows.Add(dgr);
}
GridView2.DataSource=dt;
GridView2.DataBind();
any help would be great appreciated..
scarface
|
|
|
|
|
scar_face wrote: GridView1
scar_face wrote: GridView2
This is for an obsfucation contest ?
Which line blows up ? I don't think a row can exist in two tables, I think you need to copy it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
what i meant was to copy rows from one gridview to another gridview ..so can you help me with the code...it would be of great help..
scarface
|
|
|
|
|
Google it, tons of results. But basically, you need to make a new DataRow, then copy the data column by column. Google will show you the way young padawan.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
few lines of code would help me out...i did google a lot before posting in this forum..not much help over there for this thing..
scarface
|
|
|
|
|
i ,
i am getting error's like,
Scale error during implicit conversion of NUMERIC value '195061.44' to a NUMERIC field.
Specified cast is not valid.
procedure with out put parameter as @v_End_Balance numeric(22, 2) out
in code i am giving as
cmdEndBal.Parameters.Add("@v_End_Balance", OdbcType.Numeric,22);
cmdEndBal.Parameters[2].Direction = ParameterDirection.Output;
cmdEndBal.ExecuteNonQuery();
Int32 RetVal = (Int32)(cmdEndBal.Parameters["@v_End_Balance"].Value
|
|
|
|
|
So change the type you're using, given that the given type 'is not valid'.
Perhaps casting a float to an int is the issue ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|